Reputation: 31
I have a quick question , I created some test cases using chrome driver on a Friday , today I returned and all test cases have failed ,when I checked I see that all the elements ID's or xpaths have changed , My question is why did this happen? I also need to know does this happen often?
Thank you
Upvotes: 1
Views: 375
Reputation: 21
The Application you are working is dynamic. everytime you refresh a page or sends some data to server, the dynamic element changes it attribute values. I recommend you go with dynamic xpaths. you will find many learning sites to break the ice!!
Hope this helps!!
Upvotes: 1
Reputation: 44
Please Check your web pages which are used for testing, Element ID or Xpath changes mainly due to the frameworks which is used for the web page development. (i.e) like ExtJS based applications will basically generate dynamic ids. So if any components/elements are added to the web pages, it will automatically re-generate their ids.
Please refer to this SO post.
Upvotes: 2
Reputation: 29382
My question is why did this happen? -- Possibly reason in this scenarios could be :
I also need to know does this happen often? -- It can happen at any point of time. (Lots of Web applications are changing their user Interface to give good user experience)
Upvotes: 1