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.
It's not a silly question.
As mentioned in this post, https://community.smartbear.com/t5/TestComplete-Questions/How-to-do-when-ID-always-changes/m-p/245192#M106602 if you see https://www.tutorialspoint.com/xpath/xpath_string_functions.htm you should be able to use starts-with() function i.e.
TC can use regular expressions or wildcards (see Miscellaneous) to search for objects. Unfortunately can not be used for XPath