How to use regular expression in EvaluateXpath ?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to use regular expression in EvaluateXpath ?
Hello All,
I am trying to find different table object inside a frame. In order to find table inside the frame, I am using EvaluateXpath
("//TABLE[@id='jdeGridData.*']" where jdeGridata has different numbers such jdeGridata_01,jdeGridata_02 etc.
I need to use regular expression for jdeGridData which I tried using jdeGriddata.* but that is not working.Can you please let me know how can it be done.
Regards,
Nimish
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
XPath (1.0) does not support regular expressions as well as TestComplete wildcards.
You can use native XPath syntax instead:
//table[contains(@id, 'jdeGridData')]
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
@baxatob is correct. This is one of the reasons of why XPath is not recommended approach in TestComplete world.
Object search and identification provided by TestComplete in 99% of cases is way fasted and more flexible than XPath.
In your case,
parent.Table('jdeGridData_*')
or, sometimes better
parent.WaitTable('jdeGridData_*', 10000)
should work.
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
