Page 1 of 1

Different behaviour of FindSingle-Method

Posted: Fri Nov 18, 2016 2:30 pm
by andreas.tastler
Hi

I search for listitems in a drop down. This is done by the following code.

Code: Select all

repo.IsagClient.Self.FindSingle(string.Format("form/form/container/listitem/text[@name~'^{0}\\.']", ID_Teilanwendung), 10000);
My Applicatio is a WPF-Application and I use the WPF Legacy Mode UiaOnly.

Now, I have a problem where my Ranorex Studio does not find an element when I execute it by "Run the selected items..." menu in the recording module.
But if I run the TestCase by "Run Selected Test Case" in the Test Suite everything is working fine.

Is there a technically difference between execution of code inside Ranorex Studio and running the whole TestCase?

Thank you.
Andreas

Re: Different behaviour of FindSingle-Method

Posted: Fri Nov 18, 2016 3:11 pm
by krstcs
Yes, there are some differences. When you run the selected modules, they will not have access to any of the TestCase's bindings or parameters. When you run the TestCase itself, then your modules WILL have access to these values, which is probably where your issue is because your variable ID_Teilanwendung is bound in the TestCase.

Re: Different behaviour of FindSingle-Method

Posted: Fri Nov 18, 2016 4:44 pm
by andreas.tastler
But in my case, the variable ID_Teilanwendung is not set via binding, but is set by code. Even if I change it to a static value without variables, the element will only be found, if I run the TestCase from TestSuite.
I also tried to run Studio and my Application as 32bit process, run both elevated and not elevated.
Any other idea?

Re: Different behaviour of FindSingle-Method

Posted: Fri Nov 18, 2016 5:11 pm
by krstcs
Could you post a ZIPPED copy of your project? Or create a small sample project that demonstrates the same issue? You could also send it directly to [email protected] if you want to get direct help from the Ranorex team.

In my view, this is still an issue of where you are getting the value from. When you run the modules by themselves, the modules will have no context for getting the value external to themselves, but if you run the test case then they have a different, external, context. As I said, this is a difference, even if you are not sure what the difference is, so without the project or a sample, it would be hard to be able to tell you exactly what your issue is.

Also, when you post about an issue, please always include the following as it can have an impact on what advice or troubleshooting is given:

FULL Ranorex version (currently only 6.0.2 and 6.1.1 are supported)
Windows version
Technology of system under test (Java, Flash/Flex, HTML, WPF, etc.)
The exact error message, if any
The RanoreXPath of the element in question, if applicable
A Ranorex Snapshot (not a screenshot) of the element in question, if applicable
A copy of a Ranorex Report showing the issue, if applicable
A copy of the project showing the issue, or a sample that demonstrates it

Without this info much of the advice we give is just guessing and it delays getting the problem solved because we don't know the full details.