setvalue on Android entering the value but app not recognizing input

Mobile Testing, Android App Testing.
sstowe
Posts: 62
Joined: Thu May 31, 2018 2:26 pm

setvalue on Android entering the value but app not recognizing input

Post by sstowe » Wed Sep 05, 2018 3:47 pm

Hello from a mobile super noob. I am writing my first test. I am simulating

loading app
enter realm
enter user id
enter password
touch sign in

My test steps are

run mobile app...
SetValue Name: Value Value: the correct info) with repo item for each text box
touch Sign In button

I can see the values being entered on the login page. But the app is generating the validation error that the data is not entered as if no entry has occurred. The sign in touch is not doing anything on the app either.

Can someone help me figure what I am doing wrong? Thanks

Stephanie

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3932
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: setvalue on Android entering the value but app not recognizing input

Post by odklizec » Thu Sep 06, 2018 7:43 am

Hi,

The problem is, that the SetValue action most probably does not trigger an onchange event? This is a common problem on desktop/web apps. This is why it's better/more reliable to use key press action, instead of SetValue. Below posts should help with your problem...
ios-mobile-web-button-is-clicked-but-no ... tml#p45836
set-value-press-keys-on-ipad-using-rano ... tml#p42933
viewtopic.php?f=23&t=11733&p=47139
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

sstowe
Posts: 62
Joined: Thu May 31, 2018 2:26 pm

Re: setvalue on Android entering the value but app not recognizing input

Post by sstowe » Thu Sep 06, 2018 3:29 pm

So yes, I can tell that setvalue is not triggering underlying events. I guess that is my question. I can touch the field and see the indicator that it has focus. But the mobilekeypress is not supported.

I tried (see keypress) and received a failure "Specified method is not supported. "

As you can see, there is not a lot in the way of MobileKeyPress options (see keypress2).

Is there a getting started document for mobile testing creation? I am hoping to

1. Not rely entirely on code
2. Have my mobile tests run on iOS and Android...

Thanks
Attachments
keypress2.png
keypress2.png (29.31 KiB) Viewed 197 times
keypress.png
keypress.png (24.91 KiB) Viewed 197 times

dpFourOFour
Certified Professional
Certified Professional
Posts: 38
Joined: Mon Dec 12, 2016 9:24 am

Re: setvalue on Android entering the value but app not recognizing input

Post by dpFourOFour » Fri Sep 07, 2018 12:42 pm

Hi sstowe,

In the post Pavel linked, I described the usage of execute script. This might be helpful in your case as well. The partial repository screenshot shows that your application is also based on a web-framework. Therefore please try the following code
repo.ComBottomlineEastern.WebDocument6012SbxBtbankingCom.Self.ExecuteScript("$(\"#ID_OF_YOUR_USERNAMEINPUT\").change();");
In addition, you could try the following methods as well
$('#selector').change();
$('#selector').trigger();
$('#selector').triggerHandler();
$('#selector').mouseleave();
$('#selector').mouseout();
$('#selector').mouseover();
$('#selector').focus();
$('#selector').focusin();
$('#selector').focusout();

Hope that helps,
DP
Please always include the following information to your posts
  • Ranorex Version
  • OS Version

mbrockmeier
Posts: 2
Joined: Wed Sep 12, 2018 10:43 am

Re: setvalue on Android entering the value but app not recognizing input

Post by mbrockmeier » Wed Sep 12, 2018 10:49 am

@sstowe:

This happens because Ranorex does not support native keyevents apart from the "Mobile Key Press" events. Usage of Key Sequence/Key Shortcut is currently not supported on mobile platforms (only Desktop/Web). We are facing this issue as well, so we used this workaround:
Touch Textfield
SetValue("Text", "textyouwanttoset")
Touch Textfield again
Mobile Key Press: IME_ACTION_DONE

Sadly this workaround is no longer reliable. We are now using Android Debug Bridge (adb) commands for all our text inputs, because adb simulates real key presses and also triggers the "onchange"-events in your app.

We are hoping that Ranorex implements such a function for easier use. We have created an entry on Ranorex Uservoice, which you might vote for as well, because it seems that you are facing the same problem we are facing.

https://uservoice.ranorex.com/forums/15 ... or-android

sstowe
Posts: 62
Joined: Thu May 31, 2018 2:26 pm

Re: setvalue on Android entering the value but app not recognizing input

Post by sstowe » Mon Sep 17, 2018 9:08 pm

So... what I am really reading here? Trying something like this

repo.ComBottomlineEastern.WebDocument6012SbxBtbankingCom.Self.ExecuteScript("$(\"#'a11y-realm'\").change();");

Caused an error in my AUT. And really provides a highly unsatisfactory solution. If I cannot get a plain text box to accept input, I have doubts about other elements like drop downs.

Can someone point me to Ranorex 101 on mobile testing for this type of app as I have been lead to believe it supports? Or... am I looking at an app that it does not really support without some significant gyrations?

Thanks

mbrockmeier
Posts: 2
Joined: Wed Sep 12, 2018 10:43 am

Re: setvalue on Android entering the value but app not recognizing input

Post by mbrockmeier » Tue Sep 18, 2018 7:17 am

@sstowe

You could use Ranorex to click into the textinputs and use adb to send the key sequence...

e.g.
Process.Start("adb.exe shell input text texttoenter");
Last edited by mbrockmeier on Tue Sep 18, 2018 8:11 am, edited 1 time in total.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3932
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: setvalue on Android entering the value but app not recognizing input

Post by odklizec » Tue Sep 18, 2018 8:03 am

Hi sstowe,

Have you tried the trick described here?...
set-value-press-keys-on-ipad-using-rano ... tml#p42933
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration