Dynamically verify object property in script via Keyword test on SFDC
Hi all -
I'm struggling right now to find many objects on some custom objects in Salesforce Lightning. When I use the record/playback, steps are recording, and the screenshots all look fine, but when I play back, I am unable to select certain elements. Please suggest a method to find these objects - If you need any more information, I can provide it.
I am recording in Chrome, is there a better browser to use?
For example here's an object I can't figure out out to find, so I can click it (I changed the bolded to remove a company name): Sys.Browser("chrome").Page("https://companyname.lightning.force.com/lightning/r/Contact/0033800002u4K4WAAU/view").Panel(1).Panel..., 1)
Unfortunately, no good news for you and you will have to take a difficult way regardless of whether you will continue to use TestComplete or decide to try some other tool (including Selenium).
The reason for the above is that your tested application is too dynamic and does not provide any unique and stable identifier for any web element. Thus, you will have to explore (using Object Browser) how application builds its web pages and work-out a logic of how to reliably find this or that web element on the page.
Keyword Test will not be the best one for the implementation and I would suggest to switch to pure scripting.
As a starting point, I would recommend to carefully read the documentation to understand how TestComplete searches for and addresses web elements and, based on the obtained knowledge, consider possible ways of how to search for the required web elements on the page.
https://support.smartbear.com/screencasts/testcomplete/reliable-tests-for-dynamic-objects/ (and other relevant recordings from the https://support.smartbear.com/screencasts/testcomplete/ page)
/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.