Ask a Question

Dynamically verify object property in script via Keyword test on SFDC

jpoulin
New Contributor

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)

2 REPLIES 2
AlexKaras
Champion Level 2

Hi,

 

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/testcomplete/docs/testing-with/object-identification/index.html

https://support.smartbear.com/testcomplete/docs/app-testing/web/general/object-identification/using-...

https://support.smartbear.com/screencasts/testcomplete/reliable-tests-for-dynamic-objects/ (and other relevant recordings from the https://support.smartbear.com/screencasts/testcomplete/ page)

 

Regards,
  /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.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================

Thanks Alex, appreciate the response.

cancel
Showing results for 
Search instead for 
Did you mean: