Hi Experts,
I have a ui element having innertext as 'New Search', RanorexPath I have written for this element is ".//span[@innertext~'^New\\ Search$']". But somehow ranorex is not able to find out element using this path, it clicks somewhere else on ui. Anybody plese suggest me what is going wrong here.
I am stuck due to this.
Thanks,
Rocky
RanorexPath not working
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: RanorexPath not working
Hi,
Why do you use a regex for this element? If you use span[@text='New Search'] then the element should be always found. I think you get an exception if you execute your RegEx in code, because you search for an element with the name "New \ Search" and I think this couldn't be found. Would it be possible to post us a Ranorex Snapshot of your New search element then I could provide you a few possibilities to search for your element.
How to create a Ranorex Snapshot
I would suggest you to read following blog too
http://www.ranorex.com/blog/ranorexpath-tips-and-tricks
Regards,
Peter
Ranorex Team
Why do you use a regex for this element? If you use span[@text='New Search'] then the element should be always found. I think you get an exception if you execute your RegEx in code, because you search for an element with the name "New \ Search" and I think this couldn't be found. Would it be possible to post us a Ranorex Snapshot of your New search element then I could provide you a few possibilities to search for your element.
How to create a Ranorex Snapshot
I would suggest you to read following blog too
http://www.ranorex.com/blog/ranorexpath-tips-and-tricks
Regards,
Peter
Ranorex Team
Re: RanorexPath not working
In your posted example, you have too many backslashes...
".//span[@innertext~'^New\\ Search$']" >>> should be ".//span[@innertext~'^New\ Search$']"
Also, you are searching for any span from the level of a current object (by using .//), so hopefully that is what you want to do.
Aracknid
".//span[@innertext~'^New\\ Search$']" >>> should be ".//span[@innertext~'^New\ Search$']"
Also, you are searching for any span from the level of a current object (by using .//), so hopefully that is what you want to do.
Aracknid