Standards for using dynamic locators

There will always be a set of standard objects on a page that remain static each time you navigate to the page. Those are the elements you define up-front in the page object classes: buttons, links, tables, text fields, drop-down lists, logos, and so on.

Now, say you have a page that you create dynamic elements on, such as accounts, servers, settings, or let's just say "widgets". Each time your set of tests runs, it creates all different types of widgets with various preferences, names, timestamps, and so on.

You certainly don't want to clutter up your page objects with a bunch of static elements that the data must match each time you test. In this case, you can build the dynamic locators on the fly using partial string matches of the widgets in the list, table, or page.

In this section, we will cover using single and multiple attribute locators, as well as building methods using dynamic locators from text in elements.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.216.229