Identify objects using custom id #2097
james-k-mathew
started this conversation in
General
Replies: 2 comments
-
I am able to successfully locate an element with data attribute,
await goto("https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_global_data");
await highlight(listItem({"data-animal-type":"fish"})); Can you please provide a sample where this doesn't work ? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the clarification. I tried like the following, await evaluate(link({"data-test-id":"cart_primarycheckout"}), ele => ele.click()); It is working. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
Identify objects using custom id like data-test-id
To Reproduce
We are able to identify objects in the following manner, using id, class and href
{class:"btn btn--big btn-primary continue-checkout mobile-hidden"}
{id:"form--checkout_signin_new_user--field--NEW_USER_EMAIL_ADDRESS"}
{href:"?edit_shipping_panel=1"}
We are not able to identify using custom id like data-test-id
{data-test-id:"cart_subtotal"}
For ease of automation this type of id is made available is most places in the application
We are not able to leverage that.
Is there any way to leverage id's like that
Beta Was this translation helpful? Give feedback.
All reactions