Microsoft Report Viewer and WebElement ID

Ranorex Studio, Spy, Recorder, and Driver.
Posts: 35
Joined: Wed Jan 23, 2013 4:49 pm

Microsoft Report Viewer and WebElement ID

Post by hporter » Wed Jan 23, 2013 4:57 pm

Hi, I am trying to run Ranorex against our product, which runs a report (in a browser) that outputs its results via Microsoft Report Viewer. I have set Ranorex to validate a particular element within the report results (a username). The problem is, with every run of the report, there is a new WebElement ID being assigned to that element within the report. The end result is the validation fails every time. Does anyone have any tips on how to work around this issue? Any advice would be appreciated, thanks!

User avatar
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Microsoft Report Viewer and WebElement ID

Post by Ciege » Wed Jan 23, 2013 6:44 pm

Sounds like there is not a persistent unique identifier for the element, so the WebElement ID gets assigned at runtime, which would be different for each and every execution of the test.

1) Is there another persistent, unique identifier you can use (other than WebElement ID)?
2) Is there a unique pattern to the element you want to find? If so, you can try using a RegEx expression to search for it.
3) Are there any persistent text patterns surrounding the element you want to find? If so, you can search for those and find your element.
4) If none of the above... Can you post a RanorexSpy snapshot of the MS Report viewer with your data in it (and tell us what the current WebElement ID is) so we can have a look and provide more suggestions.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!