Page 1 of 1

Help with web pages ID's changing all the time on tests

PostPosted: Wed May 23, 2018 10:53 am
by McDaniel
Afternoon.

I need some advice on the following:

Help in creating tests in pages where ID's are changing dynamically!

Any ideas?

Thanks

Re: Help with web pages ID's changing all the time on tests

PostPosted: Thu May 24, 2018 11:38 am
by eValid
McDaniel wrote:Afternoon.

I need some advice on the following:

Help in creating tests in pages where ID's are changing dynamically!

Any ideas?

Thanks


Great post McDaniel.

Indeed, tests of web pages where the ID tags are generated dynamically, can be very tricky.

There is no hard and fast rule on this kind of page, but the basic approach that eValid uses is base the test on finding page elements by NOT using the ID tags at all.

Here is a good example, using Google's gmail web client as an example of an application that uses dynamic ID tags:

http://e-valid.com/Products/Documentati ... ple03.html

In some cases we use a "geometric" trick, which means that we know (from experimenting with the page details) that a particular element is a fixed distance in the DOM tree away from an element that has a property that is time-invariant.

You can see this in in Step 2, where the mouse click is done on a DOM element that is 4 index-values above the one that contains the "Compose mail" string.

(This is a workable solution, but we do admit that it is brittle -- it will need to be adjusted if/when the page layout structure changes).


-- eValid Support