Dear ranorex team,
I have problem with defining any web element xpath.
I have element specified by attribute value //*[@class~'someContent'] but when trying to run tests, I have following error:
Argument 1: cannot convert from 'Ranorex.Unknown' to 'Ranorex.WebElement' (CS1503) - C:\RanorexTests\Project\Litecom\LitecomLib\Pages\LitecomGenralPages\ElementTreePage.cs:231,23
Problem is, I need to define element only by it's attribute value, because html element change in time: there can be span or div.
Any web element
-
- Certified Professional
- Posts: 455
- Joined: Tue Feb 18, 2014 2:14 pm
- Location: Co Louth, Ireland
- Contact:
Re: Any web element
Do your web elements have unique IDs? If so, you can use those IDs to uniquely identify your elements, in the XPath.
Re: Any web element
Use 'webelement' instead of '*' as the element type in the XPath.
//webelement[@class~'someContent']
http://www.ranorex.com/Documentation/Ranorex/
//webelement[@class~'someContent']
http://www.ranorex.com/Documentation/Ranorex/
Shortcuts usually aren't...