Isha Pinjarkar
Isha Pinjarkar

Reputation: 83

How to select Autogenerated web element

I have this xpath //*[@id="s2id_autogen8"]

After Refresh Xpath gets change. Can someone please advise how can I create customized XPath for this.

HTML Code:

<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input select2-default" id="s2id_autogen38" style="width: 220px;">

Upvotes: 1

Views: 634

Answers (2)

nitin chawda
nitin chawda

Reputation: 1388

try this if id is changing and if class is not changing and also if you want to go with xpath only

//input[contains(@class,'select2-input')]

Upvotes: 1

Vikas Ojha
Vikas Ojha

Reputation: 6950

Change your xpath to -

//*[contains(@id,'s2id_autogen')]

Upvotes: 0

Related Questions