WebDriver has different values than normal Ranorex

Bug reports.
krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

WebDriver has different values than normal Ranorex

Post by krstcs » Wed Jul 12, 2017 6:49 pm

Ranorex 7.1.0
Windows 10 Pro
Chrome, IE (didn't try others)

After sending keystrokes to an input field, I'm attempting to validate the value is entered correctly using Validate.AttributeEqual. I have tried 'Value' and 'TagValue' both. In Ranorex using local host as endpoint it works fine, returning the typed value. When using WebDriver as endpoint it returns an empty string ("") for the actual value.

Using Selenium directly it works fine when using GetAttribute, so I'm pretty sure it's not Selenium.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: WebDriver has different values than normal Ranorex

Post by Support Team » Thu Jul 13, 2017 8:08 pm

Hello krstcs,

Prior to your validation step, add a 'Capture Snapshot' action. This will give you a better understanding of what Ranorex see's during execution on the web driver. If you continue to experience issues, please provide this snapshot so I may further investigate.

Cheers,
Ned
.
Image

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

Re: WebDriver has different values than normal Ranorex

Post by krstcs » Thu Jul 13, 2017 8:48 pm

Ned,

Thank you for the reply, however, I'm not sure it helped because it shows exactly what I was saying.

After looking at the snapshot it still appears that Ranorex is not reading the Value attribute correctly coming from a WebDriver (WD) endpoint. I grab the snapshot right after the Key Sequence action. I can see the value in the field (and in dev tools and Spy), but the snapshot through WD does not contain the value, while the snapshot through localhost does have the value.

I cannot upload the snapshot here due to company restrictions (and not having a license).
Attachments
ActionTable.png
Action table
ActionTable.png (7.14 KiB) Viewed 609 times
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: WebDriver has different values than normal Ranorex

Post by Support Team » Fri Jul 14, 2017 9:02 pm

We do not have any reports of this issue, is it possible to provide a sample page demonstrating this issue? You can send it to [email protected] if you wish to discuss this more privately.

Cheers,
Ned
.
Image

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

Re: WebDriver has different values than normal Ranorex

Post by krstcs » Mon Jul 17, 2017 4:14 pm

Ned,

At this point I have no way to ensure that a sample page behaves the same way. I've tried local files and locally hosted sites, but they all seem to work correctly.

The steps are:

1. Mouse-click the field
2. Enter "test1234" in the field
3. Take snapshot of the field
4. Take screenshot of the field
5. Validate the value in the field is correct

3, 4, and 5 are working when done through straight Selenium (using a similar script) and Ranorex with localhost as endpoint. But when using Ranorex with the WebDriver as endpoint, there is NO VALUE in the value attribute and the screenshot just shows a blank field.

So, I'm pretty sure that this is an issue with Ranorex, because:

1. Running the same test steps in straight Selenium works and the value can be seen using a GetAttribute call.
2. Running it directly through the LOCALHOST endpoint works, and the value can be seen in the snapshot and a following screenshot.
3. Running the exact same script through Ranorex's WebDriver endpoint does not work, and the value cannot be seen in the snapshot or screenshot, and the validation fails.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: WebDriver has different values than normal Ranorex

Post by Support Team » Mon Jul 17, 2017 7:32 pm

Thank you krstcs for this additional information. I am not doubting that this could be an issue with our web driver automation but ultimately we need a way to duplicate the concern locally to continue investigating this issue. Without a sample or access to your application, it is very hard (if not impossible) for us to debug.

Cheers,
Ned
.
Image

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

Re: WebDriver has different values than normal Ranorex

Post by krstcs » Mon Jul 17, 2017 8:58 pm

I understand, I think I may have found a way to get you guys a look at one of our production login pages, I'm going to send the link to the support email.

One other thing I noticed is that right after this I enter a password (does the same thing) and then click a "Login" button.

In all three scenarios I listed above, the login is successful, so I know the value is being sent to the page, it's just the Ranorex WebDriver can't see it.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: WebDriver has different values than normal Ranorex

Post by Support Team » Wed Jul 19, 2017 4:12 pm

This issue has been resolved through email with the customer, but want to update anyone else who comes across this thread with the same or similar issue.

The issue was occurring because Ranorex was not getting the latest version of the DOM after making changes. Make the following changes to resolve this issue.
  • 1. Change the WebDriver plugin ‘Dom fetch mode’ to ‘Always’
    2. Remove focus from the object prior to validating/get-attribute action by adding a Invoke: Focus action on another object.
    3. Add a 5-second delay prior to prior to validating/get-attribute action (allows more time for the Dom to be fetched)
Cheers,
Ned
.
Image

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

Re: WebDriver has different values than normal Ranorex

Post by krstcs » Wed Nov 01, 2017 6:22 pm

Ranorex 7.1.3 (I cannot upgrade to 7.2 until 7.2.1 is released)
Windows 10

Ned, I'm returning to this issue because I've found another situation where it happens.

Ranorex is not fetching attribute values for most attributes of an InputTag element (checkbox). Specifically, it returns NULL for almost all values through either SPY or code. Your above workaround does not work in this instance because I'm trying to check the "Checked" state of the element before it is manipulated in the test (so it should be set at whatever it defaults to when the page loads). However, regardless of the state of the checkbox, Ranorex returns NULL when running through a WebDriver endpoint, but it returns the correct value when run through the localhost endpoint.

Selenium also returns the correct value natively, but you have to use the "Selected" property, there is no "Checked" attribute. It appears that Ranorex is not checking the correct property when using the WebDriver plugin.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: WebDriver has different values than normal Ranorex

Post by Support Team » Fri Nov 10, 2017 9:46 pm

Hi krstics,

After testing this locally, I observed the same as you described. I have since sent this issue to our developers to be further investigated. Currently, we do not know if and when this issue will be fixed. This depends on various factors. Nevertheless, all new features, updates, and bug fixes are documented in the release notes with every new version release of Ranorex.

Cheers,
Ned
.
Image

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

Re: WebDriver has different values than normal Ranorex

Post by krstcs » Mon Nov 13, 2017 2:29 pm

Thanks Ned