Get Value Action in Recorded Module is misbehaving

Bug reports.
Vaughan.Douglas
Posts: 250
Joined: Tue Mar 24, 2015 5:05 pm
Location: Des Moines, Iowa, USA

Get Value Action in Recorded Module is misbehaving

Post by Vaughan.Douglas » Wed Apr 25, 2018 3:06 pm

Ranorex 8.1.1 (Visual Basic)
Unfortunately I'm dealing with HR Data so no SnapShot will be forthcoming, but I've been seeing this behavior in multiple types of elements and it appears to be repeatable regardless of the repo item. I don't know when this behavior started, but I don't think it's always done this. I've been more wrong about more important things before.

I'm using the "Get value" action in a recorded module to capture the innertext and bind it to a parameter. I started seeing this when the specific attribute I'm going for wasn't listed in the "get value" context menu.

Steps to recreate:
  • Drag object from repo onto recorded module
  • Select "Get value" I want "innertext" but it isn't listed
  • Selecting an attribute is required so pick one
  • Notice the red warning icon over the step number
  • Change the attribute name to "innertext"
  • Move directly over to the variable column
  • Select a variable from the list or add a new variable
  • The variable is now bound, the red icon overlay is gone but the attribute has reverted to the previously selected value
As far as being anything specific to my AUT, you can achieve the same result by selecting an attribute in the context menu and changing it as outlined to another value that is in the context menu. Example: as seen above select "Abbr". Changing it to "Title" will yield the same behavior.
GetVal_No_Innertext.png
GetVal_No_Innertext.png (45 KiB) Viewed 233 times
Doug Vaughan

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

Re: Get Value Action in Recorded Module is misbehaving

Post by odklizec » Thu Apr 26, 2018 7:38 am

Hi,

What kind of element is the one you are trying to get the value from (technology, adapter type)? I mean, it's most probably not a standard HTML input or button, with available InnerText? It seems as if Ranorex is not able to get the InnerText from that element?

Have you inspected the element with Spy?
Could you please try to change the adapter type of given element (from "default" to one of the listed adapters)?
Any chance you can reproduce it with something non-sensitive, so you could post a Ranorex snapshot of the problematic element?
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

Vaughan.Douglas
Posts: 250
Joined: Tue Mar 24, 2015 5:05 pm
Location: Des Moines, Iowa, USA

Re: Get Value Action in Recorded Module is misbehaving

Post by Vaughan.Douglas » Mon May 07, 2018 3:28 pm

odklizec wrote:Hi,

What kind of element is the one you are trying to get the value from (technology, adapter type)? I mean, it's most probably not a standard HTML input or button, with available InnerText? It seems as if Ranorex is not able to get the InnerText from that element?

Have you inspected the element with Spy?
Could you please try to change the adapter type of given element (from "default" to one of the listed adapters)?
Any chance you can reproduce it with something non-sensitive, so you could post a Ranorex snapshot of the problematic element?
As I mentioned, this doesn't appear to be element or attribute specific.
  • Add a Get Value action to a recorded module
  • Select an attribute
  • Bind to a variable
  • Change the attribute
I tested this out against the .//input[#'search_keywords'] object on this page.
Doug Vaughan

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

Re: Get Value Action in Recorded Module is misbehaving

Post by odklizec » Wed May 09, 2018 8:20 am

Hi,

I can confirm the issue. It appears that there is missing some kind of confirmation of manually entered attribute name? Anyway, I still think that missing InnerText must be somehow related to the OS or element itself? For example, I can see InnerText for search input you mentioned?
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

Vaughan.Douglas
Posts: 250
Joined: Tue Mar 24, 2015 5:05 pm
Location: Des Moines, Iowa, USA

Re: Get Value Action in Recorded Module is misbehaving

Post by Vaughan.Douglas » Wed May 09, 2018 1:05 pm

odklizec wrote:Hi,

I can confirm the issue. It appears that there is missing some kind of confirmation of manually entered attribute name? Anyway, I still think that missing InnerText must be somehow related to the OS or element itself? For example, I can see InnerText for search input you mentioned?
I think it goes further than that. The same issue appears to occur anytime I change the attribute (manually entered or selected from the list). It seems like the validation of the attribute is clearing the bound variable.
Anotherway.png
Anotherway.png (54.29 KiB) Viewed 177 times
Doug Vaughan

Vaughan.Douglas
Posts: 250
Joined: Tue Mar 24, 2015 5:05 pm
Location: Des Moines, Iowa, USA

Re: Get Value Action in Recorded Module is misbehaving

Post by Vaughan.Douglas » Wed May 09, 2018 1:52 pm

A few more details:

Using the Validate step: changing the specific validate method (eg "AttributeEqual" to "Exists") DOES wipe out the "Match name" and "Match value" column. However changing the attribute/"match name" itself (eg "Innertext" to "ID") does NOT impact the bound variable/"match value" column.

I would consider this a bug as well. I'd guess it has to do with the interaction of the UI recorded module and the underlying generated code, and a developer is going to say that's not a bug, you need to submit a feature request. So goes the life of a QA.

Also, why in the world does the Get Value step default message tell you everything EXCEPT what the actual value.
Ranorex Report wrote:Getting attribute 'innertext' from item 'InternalApps.HomePage.DirectReports_DetailedView.JobCode' and assigning its value to variable 'EE_JobCode'.
Why not just say what the value was:
Ranorex Report SHOULD wrote:Getting attribute 'innertext' from item 'InternalApps.HomePage.DirectReports_DetailedView.JobCode' and assigning its value, '0123456', to variable 'EE_JobCode'.
Doug Vaughan

ahoisl
Certified Professional
Certified Professional
Posts: 125
Joined: Fri Sep 07, 2007 8:16 am

Re: Get Value Action in Recorded Module is misbehaving

Post by ahoisl » Wed May 09, 2018 10:21 pm

Hi guys,

First, thank you for your input, I will try to address all of the issues mentioned. Please, comment back if I missed one :)
Vaughan.Douglas wrote:Add a Get Value action to a recorded module
Select an attribute
Bind to a variable
Change the attribute manually by typing in text
This is indeed a problem, I guess not just for the Get Value action. If you enter a text manually and do not confirm it by pressing "Enter", clicking in another control or in the empty space of the record table, then the value is not confirmed. I remember that this is a known issue, but I will bring it up to the development team again.
Meanwhile, when manually changing a value by typing in text, make sure to confirm it by hitting "Enter", please. Thanks!
Vaughan.Douglas wrote: Using the Validate step: changing the specific validate method (eg "AttributeEqual" to "Exists") DOES wipe out the "Match name" and "Match value" column. However changing the attribute/"match name" itself (eg "Innertext" to "ID") does NOT impact the bound variable/"match value" column.
Changing the validation method to "Exists" will hide the "Match name/value" fields, but if you change back to "AttributeEqual", the former selected values will be shown again - at least what I've tested (with 8.1.1). Do you experience something different?
Vaughan.Douglas wrote:Also, why in the world does the Get Value step default message tell you everything EXCEPT what the actual value.
For every action, the log message is issued before an action is executed, so for the GetValue action the value is not fetched yet at that moment. We could just add an additional log message after the action was executed, but that is definitely a feature request :D

Regards,
Alex
Ranorex Team