FlowStack
FlowStack

Reputation: 82

TestCafe selector for a textbox with same ID

I am trying to type text in the textbox using selectors. However the textbox shares the same ID. How can i index selectors. I was able to do it via xpath. However i need to pass it as selector

textbox id = #input1

Upvotes: 0

Views: 286

Answers (1)

Alex Skorkin
Alex Skorkin

Reputation: 4274

Element IDs should be unique within the entire document. I recommend that you avoid using the same ID for several elements.

You might want to enumerate elements by their type (input). Refer to the Enumerate Elements Identified by a Selector topic where this example is illustrated in action.

Upvotes: 1

Related Questions