Page 1 of 1

setvalue on Android entering the value but app not recognizing input

Posted: Wed Sep 05, 2018 3:47 pm
by sstowe
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

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

Posted: Thu Sep 06, 2018 7:43 am
by odklizec
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

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

Posted: Thu Sep 06, 2018 3:29 pm
by sstowe
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

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

Posted: Fri Sep 07, 2018 12:42 pm
by dpFourOFour
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

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

Posted: Wed Sep 12, 2018 10:49 am
by mbrockmeier
@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

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

Posted: Mon Sep 17, 2018 9:08 pm
by sstowe
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

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

Posted: Tue Sep 18, 2018 7:17 am
by mbrockmeier
@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");

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

Posted: Tue Sep 18, 2018 8:03 am
by odklizec
Hi sstowe,

Have you tried the trick described here?...
set-value-press-keys-on-ipad-using-rano ... tml#p42933

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

Posted: Thu Jan 31, 2019 11:17 am
by msys_mg
Hi all,

Is there already no "good" method to solve this problem? Why can't exist a easy "Send Value"-method?

I tested the solutions listed in this forum i found but nothing really works good for me...

I have a android tablet (7.0) with a angular-js app to test. Genereally it works fine but i can't validate the values, a user can type in (my app has a settings-menu with hostname, port, mandant, ssl and so on...).

Help! Please ;-)

Thx, Michael

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

Posted: Thu Jan 31, 2019 11:54 am
by odklizec
Hi,

At first, what exactly is your problem? From your post it seems, as if the problem is validation? But this topic is about entering values? ;)

At next, without a bit more detailed steps and, at very least, Ranorex snapshot (NOT screenshot) of the app under test, there is not much anyone here can do or suggest. Generally speaking, Angular is a very complicated thing to automate and mobile-based app adds yet another level of complexity. But as mentioned before, without seeing the snapshot, it's impossible to suggest something reliable.

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

Posted: Thu Jan 31, 2019 2:00 pm
by msys_mg
Hi, ok, sorry, so i try to describe my use case.

i have a app from our programmers i will test. On First start the app, a setup is opened where a user can type in hostname and port for example.

So with ranorex i make a solution to test the mobile app - for example this dialog.

What works so far is that I have integrated the mobile device as an endpoint, ranorex service connected to the app and also integrated a recording module. I can start the test, touch on buttons and so on...

Now I want to check if the app displays an error if I enter invalid values in normal input fields. A port-number with value 888888 for example. When i enter the values directly on the device, this also works, an error message is displayed at or behind the input. Obviously, the validation is triggered directly by typing on the keyboard. Entering the values with setvalue (what I do about ranorex) probably lacks the OnChange event, which does not trigger validation.
It seems like I have to take care of triggering the onchange event, which has to do with the input field, hence the post here in this chat.

sorry about my bad english, i hope its reasonably understandable

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

Posted: Thu Jan 31, 2019 2:09 pm
by odklizec
Hi,

OK, I now understand ;) From my experience, Angular apps are generally tricky to automate. I'm not quite sure why there is no somewhat more reliable "set value" method for mobile devices, but I guess it's mainly because of mobile OS security restrictions?

Have you tried all of the suggested methods (adb command, execute script, etc) and on different UI elements? The thing is, that mobile input must be often performed on certain ancestor/parent element, instead of the last one found with spy. Could you please post a Ranorex snapshot of the problematic input(s)?