Forum Discussion
I spoke with my developer and we do not name the our information in our website. This is apparently being named by the TestComplete product.
Here is the information that I found using the object spy.
Sys.Browser("edge").Page(FindElement("//div[6]/div[contains(@class, 'ant-select-item-option-content')]")
FindElement("//div[6]/div[contains(@class, 'ant-select-item-option-content')]")
I took the element name from the name property.
How would be a good way to generate the right kind of script for a csv file that I will be using.
Hi,
> we do not name the our information in our website.
This is definitely the approach that makes your life significantly more difficult.
If developers cannot/do not want to add unique and stable identifiers to web elements your test code needs to interact with and you cannot convince them to do this, then your options are either to use OCR (and pay extra for additional license) or stick to those generic XPath-es that you provided and inform your stakeholders that test code will be quite brittle and flaky despite all your efforts.
Note: Unless you are going to execute your tests using browser cloud providers (like CrossBrowserTesting or BrowserStack), I would recommend to disable the Project Options | Open Applications | Web Testing -> Use XPath and CSS Selectors For Web Objects setting and switch from cross-platform to 'classic' web elements search mode which is way more functional, faster and convenient.
> csv file that I will be using
Your code will depend on what you are going to have in this .csv file and the identification approach that you will use to find required 'anchor' web element that I mentioned in my previous reply.