variable default value not used in set value on droplist

Ranorex Spy, Recorder, and Studio.
qa-auto
Posts: 37
Joined: Mon Aug 05, 2019 10:46 pm

variable default value not used in set value on droplist

Post by qa-auto » Thu Sep 26, 2019 3:53 pm

Hi,

Has anyone seen issues with a default value getting ignored when selecting option in a DL?

Scenario
module variable 'varStateID' = default 99
element path for DL selector = .//select[@id='ctl00_ctl00_MainContent_ChildContent1_FrmCustIdentification_cboState']
action = Set value TagValue $varStateID element

During execution, the set value just skips right over the field.

I've used this approach many times to consistently select states in a DL...but in one form, in one case, I am relying initially on the default value until I have test data defined.

Thoughts?

Lorinda

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

Re: variable default value not used in set value on droplist

Post by odklizec » Thu Sep 26, 2019 4:41 pm

Hi,

Does this problem happen both if you run entire test suite and standalone recording module? Have you tried to set a breakpoint at failing line of code and debug it?

My guess is that it fails when you run entire test suite? Do you have any data connector connected to the module variable? In this case, data connector value has priority over default module variable.
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

westernira
Posts: 1
Joined: Sun May 19, 2019 3:46 pm

Re: variable default value not used in set value on droplist

Post by westernira » Fri Sep 27, 2019 1:51 pm

Have the user select items on page 1, then store those values in the session. Then on page two, set the values from the session as the default value in the drop down list. If they change their selection, simply update the session variable to the new value. Then you could repeat ad infinitum.

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

Re: variable default value not used in set value on droplist

Post by odklizec » Sat Sep 28, 2019 8:15 am

Hi,

Have you checked this blog post?...
https://www.ranorex.com/blog/sharing-da ... o-another/
This article is exactly about sharing data between modules.
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

qa-auto
Posts: 37
Joined: Mon Aug 05, 2019 10:46 pm

Re: variable default value not used in set value on droplist

Post by qa-auto » Mon Sep 30, 2019 5:14 pm

Thanks, Pavel. Yes, I have read the link you shared.

The issue was this "...in this case, data connector value has priority over default module variable."

That put me on the right track!

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

Re: variable default value not used in set value on droplist

Post by odklizec » Tue Oct 01, 2019 9:09 am

Hi,

Good to hear you managed to track the source of issue! ;)
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