Set Value/Press Keys on iPad using Ranorex browser

Mobile Testing, Android App Testing.
steven.fitzpatrick
Posts: 13
Joined: Wed Oct 28, 2015 3:54 pm

Set Value/Press Keys on iPad using Ranorex browser

Post by steven.fitzpatrick » Tue Mar 01, 2016 3:19 pm

Hi,

I'm currently attempting to automated the creation of a post on our website and the first stage is entering a few values in a web CMS with the Ranorex browser but I've already ran into a few problems.

Through Ranorex Spy I can see a few of the elements are '/input' field and I am able to user Set Value to enter values against these field. The first issue is that the page does not dynamically update or register that any information has been entered into the field (eg. The character count is not updated & save button is still disabled). Is there any reason for this? I can user a work around but I'm interested to know.

The second issue I've encounters is not all the text fields are '/input' ones, a few fields are shown with '/div' tags and I'm unable to enter values against them. If I use Set Value then Ranorex thinks I've entered a value & the test passes but no value appears on the iPad. I've also tried PressKeys but that resulted in a "Method not supported" error.

Has anyone experienced a similar issues or able to advise on how to fix (or workaround) this issue?

Thanks

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

Re: Set Value/Press Keys on iPad using Ranorex browser

Post by odklizec » Tue Mar 01, 2016 3:34 pm

Hi,

As for the first issue, this is usually caused by the fact the SetValue does not trigger keyboard-based events assigned to the element in question (typically onkeypress event). In other words, you will have to use PressKey method instead of SetValue.

As for the second issue, could you please post a Ranorex Snapshot of the problematic elements?
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

steven.fitzpatrick
Posts: 13
Joined: Wed Oct 28, 2015 3:54 pm

Re: Set Value/Press Keys on iPad using Ranorex browser

Post by steven.fitzpatrick » Tue Mar 01, 2016 4:06 pm

Thanks for the quick reply, I thought that might be why the Save button didn't activate for the first part of my problem; I tried using PressKeys and entering a value but I also got the "Method not supported" error for that as well.

I've added a Snapshot of the elements. The one I seen to be having issues with is: /mobileapp[@title='ranorex.RxBrowser']/form/?/?/dom/body/div[3]/?/?/div/section/form[@name='articleBuilder']/div/div/div[2]/tag[@tagname='input-content-editable']/div/div[2]

The two input elements below it accept values when I use SetValue but none of them seem to accept values via the PressKeys method.

Thanks again,
Last edited by steven.fitzpatrick on Wed Mar 02, 2016 11:43 am, edited 1 time in total.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Set Value/Press Keys on iPad using Ranorex browser

Post by krstcs » Tue Mar 01, 2016 4:26 pm

Divs should not be used as input elements. This appears to be a bug in the page.

Ranorex only allows certain functions on certain element types. If your element type doesn't support the selected action, then you get that error.

Have your developers fix the element tag to be an appropriate tag type and that will allow Ranorex to identify and allow the right actions on the element.
Shortcuts usually aren't...

steven.fitzpatrick
Posts: 13
Joined: Wed Oct 28, 2015 3:54 pm

Re: Set Value/Press Keys on iPad using Ranorex browser

Post by steven.fitzpatrick » Wed Mar 02, 2016 11:43 am

Thanks for the info, I had wondered why two of the tags were different from the rest but thought Ranorex would be able to send keys regardless.

Thanks for the help, it's been raised so hopefully I'll get an update soon & get it working.

Cheers

steven.fitzpatrick
Posts: 13
Joined: Wed Oct 28, 2015 3:54 pm

Re: Set Value/Press Keys on iPad using Ranorex browser

Post by steven.fitzpatrick » Mon Mar 07, 2016 3:40 pm

I'm still waiting on certain div tags being updated to inputs by our developers but I've encountered an issue with using PressKeys again. I mentioned this in my original post but I have an input tag that I am able to set a value on but as was mentioned already, this doesn't trigger a keyboard event and as a result the 'Search' button on the site I'm testing remains disabled.

When I attempt to use PressKeys to send test to this input field then the test fails and Ranorex give me a "Specified method is not supported" error.

Does anyone know why this error appears or if there is a workaround for it? I'd initially thought I could just update another search field at the same time to enable the search button but when I do that then hit search, the original value (entered by SetValue) is not taken into account.

any help would be appreciated. Cheers

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Set Value/Press Keys on iPad using Ranorex browser

Post by Support Team » Wed Mar 09, 2016 2:41 pm

Hello Steven,

First, you have to make sure that the keyboard is visible at the moment you execute the Mobile Key Press action.

I assume that the action is executed for the wrong repository item. I would suggest executing the action on the mobileapp-item directly.
mobile_key_press.png
Please let me know if this solves the issue.

Sincerely,
Johannes
You do not have the required permissions to view the files attached to this post.

steven.fitzpatrick
Posts: 13
Joined: Wed Oct 28, 2015 3:54 pm

Re: Set Value/Press Keys on iPad using Ranorex browser

Post by steven.fitzpatrick » Thu Mar 10, 2016 1:15 pm

Hi,

I've attempted your suggested steps but that's not exactly what I'm looking for. I'm attempting to enter a text value in an input field (eg. "Hello World") with the PressKeys("Hello World") user code rather than use the Mobile Key Press(Enter) as shown in your screenshot.

I've made sure the keyboard is visible before trying PressKeys with user code as follows:

Code: Select all

repo.Browser.Dom.HeadlineField.Touch();
Delay.Milliseconds(2500);
then I've tried each of the following in turn but none seem to work:
1)

Code: Select all

repo.Browser.PressKeys("Hello World");
//This give a "Browser.AppFolder does not contain definition for PressKeys" error
2)

Code: Select all

repo.Browser.Self.PressKeys("Hello World");
//This gives a "Can't synthesize key sequence <Hello World> because current active keyboard doesn't support it" error.
3)

Code: Select all

repo.Browser.Dom.Self.PressKeys("Hello World");
//Same error as #2
4)

Code: Select all

repo.Browser.Dom.HeadlineField.PressKeys("Hello World");
//Gives a "Specified method is not supported" error.
Is there anyway to use the user code - PressKeys("Hello World"); - when testing on a mobile device, or failing that, is there anyway to get SetValue to be resisted on the page when I then go to search?

Thanks,
Steven

pavan.parmar
Posts: 2
Joined: Tue May 10, 2016 4:08 pm

Re: Set Value/Press Keys on iPad using Ranorex browser

Post by pavan.parmar » Tue May 10, 2016 4:12 pm

Hi Ranorex Support Team,

I am also facing this issue for one of our projects. Can you please help us with the resolution on this? I am facing exact same issue which steven specified.

Thanks,
Pavan

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Set Value/Press Keys on iPad using Ranorex browser

Post by Support Team » Thu May 12, 2016 8:37 am

Hello Pavan,

May I ask if you have the issue with the UITextField? The following bug was fixed in our new major release Ranorex 6.0:
  • Setting an attribute value on iOS UITextField controls now triggers delegates registered on the control.
I would suggest updating to Ranorex 6.0, which can be found in our download archive. Before you update to the latest version, please have a look at the features, bug fixes and breaking changes in the release notes.

Please let me know if this resolves the issue.

Sincerely,
Johannes

pavan.parmar
Posts: 2
Joined: Tue May 10, 2016 4:08 pm

Re: Set Value/Press Keys on iPad using Ranorex browser

Post by pavan.parmar » Fri May 13, 2016 6:18 pm

Yes Johannes. The issue is with the UITextField. I will download the latest Ranorex setup and test it.

Although, i had done a work around which worked for me. Here is the code i am using now...
txtSearchBox.PressKeys(" ");
txtSearchBox.TextValue="test data";
Delay.Seconds(5);
txtSearchBox.Focus();
txtSearchBox.PressKeys("{ENTER}");

MattDonCDN
Posts: 7
Joined: Tue Mar 28, 2017 7:51 pm

Re: Set Value/Press Keys on iPad using Ranorex browser

Post by MattDonCDN » Tue Mar 28, 2017 8:42 pm

Hello,

I'm using Ranorex 6.2.1 with an Android Hybrid app and I'm facing a similar issue. I need to enter text in the password field in order for the Login button to become clickable. The text seems to get entered, but the Login button is not becoming clickable. The Mobile Key Press actions against the password field element (tried PressKeys() via code as well) all seem to return method not supported event if the device keyboard is up.

Is there any way around this? If I could get PressKeys() to work perhaps this would

I read somewhere else that there may be a way to trigger onBlur() but I have not been able to figure that out.

Any suggestions are most appreciated.

Note -> I'm new to Ranorex, but have used other automation solutions such as Selenium, Telerik Test Studio and UFT.

MattDonCDN
Posts: 7
Joined: Tue Mar 28, 2017 7:51 pm

Re: Set Value/Press Keys on iPad using Ranorex browser

Post by MattDonCDN » Wed Mar 29, 2017 4:10 pm

I was able to work around this by sending the keyPress actions to the top level item in the Dom (performed a space then a delete after the password value was set).

Unfortunately the original problem of setValue not triggering onBlur or onChange once the text is entered is still an issue.

Thanks,
Matt

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Set Value/Press Keys on iPad using Ranorex browser

Post by Support Team » Fri Mar 31, 2017 11:32 am

Hi Matt,

This is a known issue and there's already an entry in our internal bug tracking system.

Currently, we do not know if and when this issue will be fixed. This depends on various factors. Nevertheless, all reported bugs and feature requests are documented in the release notes, with every new version release of Ranorex.

In the meantime, I would suggest using the workaround that you have already mentioned. I’m afraid there is no other workaround at the moment.

Code: Select all

//Set the value
repo.MobileApp.Input.Element.SetAttributeValue("Value", "TestValue");
//Create a space in order the value will be applied
repo.MobileApp.Self.PressKeys("{SPACE}");
//Delete the not needed space
repo.MobileApp.Self.PressKeys("{DEL}");
Thank you for your understanding.

Sincerely,
Johannes

MattDonCDN
Posts: 7
Joined: Tue Mar 28, 2017 7:51 pm

Re: Set Value/Press Keys on iPad using Ranorex browser

Post by MattDonCDN » Wed Apr 12, 2017 9:16 pm

Unfortunately this workaround that is successful on Android does not seem to be working on iOS. I see the following error: "Cannot synthesize keysequence <{SPACE}> because the current active keyboard doesn't support it. "

I tried doing ENTER instead, and did not see the error mentioned above, but the input text was still not recognized unfortunately.

Any suggestions on how to proceed for iOS?