Forum Discussion

roli62's avatar
roli62
Occasional Contributor
2 years ago

Find Element with part of a string

Maybe it is a silly question, but I am new to testcomplete and I cannot solve the following problem:

 

In the code I want to find an object which works like this:

Aliases.browser.displayContracts_changeAndReleaseOrders_ZSD_COR_CHANGE.frameItsframe1.FindElement("//div[.='Purchase Order 0650143798']").Click()

The problem is, that I do not know the number in the string in advance so I need something that can find the element by only giving the fix substring 'Purchase Order'.

I tried

...FindElement("//div[.='Purchase Order .*']")
...FindElement("//div[contains(@contentText,'Purchase')]")

but none of them works.