Step Works When I run it as a Module but not as part of Test Case

Ranorex Studio, Spy, Recorder, and Driver.
cloudbabush
Posts: 3
Joined: Thu Sep 01, 2022 2:31 pm

Step Works When I run it as a Module but not as part of Test Case

Post by cloudbabush » Wed Nov 23, 2022 6:31 pm

I am facing an issue wherein : tere is a step which clicks an element identified by the following RanoreXpath

Code: Select all

/form[@automationid='FormServerSettings']/element[@automationid='navigationPane1']/container[@caption='Tags']/container[@caption='']/element[@automationid='xtraTabControl1']/tabpagelist[@accessiblerole='PageTabList']/button[1]
The above step when I run it as part of the module it clicks.
However when I add the module to a test case and when i run the test case I get the following error message every time

Code: Select all

No element found for path 'element[@automationid='navigationPane1']/container[@caption='Tags']/container[@caption='']/element[@automationid='xtraTabControl1']/tabpagelist[@accessiblerole='PageTabList']/*[1]' at step 'button[1]' after 96 attempts within 20s.
I have tried replacing button[1] with *[1] in the RanoreXpath , but still no luck same behavior i.e clicks in module run mode not in test case run mode.

Any thoughts much appreciated.

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

Re: Step Works When I run it as a Module but not as part of Test Case

Post by IvanF » Wed Nov 23, 2022 7:59 pm

Hi,

In your element identification, you list domain as "form[@automationid='FormServerSettings']" while the error message says the script is looking for the path starting with "@automationid='navigationPane1'".

So, adding the module to the test case seemingly changes the domain identification for some reason. After you've added the module, please check the test case repository to see if the element in question is being assigned to the wrong base path.

Automation IDs in general are tricky, so I'd also suggest trying to replace it with the wildcard (something like //container[@caption='Tags']//tabpagelist[@accessiblerole='PageTabList']/button[1]) or find a different attribute.

cloudbabush
Posts: 3
Joined: Thu Sep 01, 2022 2:31 pm

Re: Step Works When I run it as a Module but not as part of Test Case

Post by cloudbabush » Thu Nov 24, 2022 10:44 am

There appears to be a rooted folder that was causing the discrepancy in the base path and hence the issue. Don't recall creating the rooted folder.. Thanks for pointing out the root cause .