Last activity: 4 Oct 2018 11:08 EDT
Using Test ID in Selenium Automation Testing
Could you please any one help me to use Test ID in Selenium Automation Testing?
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Hi, I've escalated this to the relevant SME team and hopefully you will get a reply shortly.
Thank you Chuat..
our customer also wants to use Selenium for functional UI testing. We have seen some challenges with using the several UI ids like "data_test_id". Some of these challenges are e.g. using the correct ID when operating in a grid. Is there some general documentation on how to use the testing facilities in Pega? We are using 7.1.7.
Any one developed test script using selenium webdriver with PEGA TEST ID property.
if yes,Please let me know.
Thanks in advance.
National Australian Group
You find a way to use the data-test-id using the selenium webdriver?
I am new to selenium and PEGA TEST ID property, could someone help me on how to use this to identify an element in details. I went through some articles and understood that we need to use the Test ID as the Pega dynamically changes its page property, but not sure how to use the Test ID in the Selenium code. Kindly guide me to get it started.
There should not be anything Pega-specific about using test IDs to locate UI elements in your application.
Here is a generic explanation on how IDs can be used in Selenium: http://www.software-testing-tutorials-automation.com/2014/01/how-to-locate-elements-by-id-in.html
If this is not what you're looking for, please elaborate further.
X & G Inc
driver.findElement(By.id(...)) is looking for id attribute under the element. Try to use Xpath to locate data-test-id for the element.
Below are the different types of Locators in Selenium :
- Class Name
- Tag Name
- Link Text
- Partial Link Text
- CSS Selector
Selenium does not provide facility to use data-test-id, which is unique id provided by Pega. This is the biggest limitation with Selenium for Pega application.
If Selenium can find a way to use data-test-id then it would be very much helpful to automate Pega applications.