I hope you are using the selenium webdriver for your test case automation. I have a few queries for you as follows:
Which pega version you are using?
Which browser you are using?
Did you the record the test case using the webdriver, if so is it recorded from eclipse or browser supported driver?
The above issue is happening for all the web elements or any specific webelement?
I hope you had added the wait conditions properly to complete the loading of page if any delay. Also share your sample test case which is created for our further understanding.
Note: Basically if you record the test case using the web driver then it should work at your end. If you had not tried to record a sample test case kindly try it and share the result, for example : login functionality.
Generally Pega UI components has an additional property data-test-id which will be unique ID that needs to be generated for the UI element, by using this unique id you can able to read the element in your test case. For more information about the Test ID refer this page. Hope this will help you in resolving your issue.
Unfortunately Selenium does not provide the facility to use data-test-id, which is unique id provided by Pega. This is the biggest limitation with Selenium for Pega application. If we can find a way to use data-test-id then it would be very much helpful to automate Pega applications.
Beginning with Pega 7.2.2, you can use PegaUnit testing to create test cases to validate the quality of your Pega 7 application by comparing the expected test output with results that are returned by running rules. PegaUnit testing is supported for the following rule types:
In addition, if you have the AutomatedTesting privilege, you can use Automated Unit Testing (AUT) and switch between PegaUnit testing and AUT.