Forum Discussion

nimishbhuta's avatar
nimishbhuta
Frequent Contributor
7 years ago

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

2 Replies

  • baxatob's avatar
    baxatob
    Community Hero

    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')] 
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    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.