OptionTag "Select" is not working in Ranorex ver 10.7

Ask general questions here.
rk325
Posts: 23
Joined: Mon Mar 27, 2023 6:02 pm

OptionTag "Select" is not working in Ranorex ver 10.7

Post by rk325 » Wed May 31, 2023 4:31 pm

I was running version 10.5.4 2 days ago, when I suddenly switched to 10.7. The following code worked correctly with 10.5.4, but stopped working with 10.7:

Code: Select all

OptionTag ddValue = Host.Local.FindSingle<OptionTag>(path + "/option[@Label='" + selectValue + "']");
ddValue.Select();
Delay.Milliseconds(10000);
The rest of the code clicks the "save" button and when it gets back to the original page, this dropdown never gets updated. I am trying variations of the different options like:

Code: Select all

OptionTag ddValue = Host.Local.FindSingle<OptionTag>(path + "/option[@Label='" + selectValue + "']");
ddValue.MoveTo();
ddValue.PerformClick();
ddValue.Select();
//ddValue.Click();
//dd.Click(location);
Delay.Milliseconds(10000);
But still is not working. Any ideas why? Is it version 10.7? Maybe I should go back to 10.5.4, if so, how?
Thanks

IvanF
Posts: 151
Joined: Thu Aug 11, 2022 8:55 pm

Re: OptionTag "Select" is not working in Ranorex ver 10.7

Post by IvanF » Fri Jun 16, 2023 4:21 pm

You can revert to a different version by downloading the appropriate installer from https://www.ranorex.com/download-archive/

There was an issue with Select that may or may not have been resolved, which error are you getting - creating the OptionTag element (line 1) or interacting with it (line 2)?

If line 2, you can try to put "continue on failure" around it:

try {
OptionTag ddValue = Host.Local.FindSingle<OptionTag>(path + "/option[@Label='" + selectValue + "']");
ddValue.Select();

Delay.Milliseconds(10000);

} catch(Exception ex) { Report.Log(ReportLevel.Warn, "Module", "(Optional Action) " + ex.Message, new RecordItemIndex(1)); }

rk325
Posts: 23
Joined: Mon Mar 27, 2023 6:02 pm

Re: OptionTag "Select" is not working in Ranorex ver 10.7

Post by rk325 » Fri Jun 16, 2023 7:27 pm

I went back to Ranorex version 10.5.4 for development, but seems we are running the latest, 10.7 in our Pipeline server and again the dropdown does not work. I was told we want always want the latest versions.

This used to be an issue with version 10.2.3, see invoke-select-stopped-working-on-10-2-3 ... cdd37c7553
What happened? Why did it come back to 10.7 ?

I haven't tried any other version between 10.5.4 and 10.7, so I cannot tell where it came back. I am doing that workaround to continue testing in the Pipeline, but this time I have to manually set the value for the dropdown, since the program will not crash but simply will not set the value of the dropdown either!

I will report this to support to let them know.

IvanF
Posts: 151
Joined: Thu Aug 11, 2022 8:55 pm

Re: OptionTag "Select" is not working in Ranorex ver 10.7

Post by IvanF » Mon Jun 19, 2023 4:01 pm

Thanks for reporting to the support.

I haven't tried the code below for 10.7, but maybe this OptionTag building will work

String ddValuePath = repo.ApplicationUnderTest.ddValue.GetPath().ToString();
((OptionTag)$"{ddValuePath}/option[@Label='{selectValue}']").Select();

It does rely on you having the element in the repo though.

rk325
Posts: 23
Joined: Mon Mar 27, 2023 6:02 pm

Re: OptionTag "Select" is not working in Ranorex ver 10.7

Post by rk325 » Mon Jun 19, 2023 7:29 pm

Thank you Ivan. I tried your solution. It worked on 10.5.4 but not in our Pipeline; the dropdown still does not get updated.

I will switch to 10.7 in my localhost to verify this error and verify it does not throw an exception. I remember when I reported it back, it did not throw an exception; it simply did not update the dropdown. But my pipeline throws an exception, so I had to "capture" that error and skip it. But still does not update the dropdown.

My pipeline is also is throwing another error in line:

Code: Select all

 ExecuteScript("window.location.reload(true)");  
Again, in my localhost I do not get that error running 10.5.4.
I'll see how this goes.

IvanF
Posts: 151
Joined: Thu Aug 11, 2022 8:55 pm

Re: OptionTag "Select" is not working in Ranorex ver 10.7

Post by IvanF » Mon Jun 19, 2023 7:39 pm

ExecuteScript may be related to this thread - clarity-required-on-executescript-ranor ... 23203.html

The Ranorex team is looking into solutions for the extension update.