Your Privacy
We use cookies to give you a better experience in Alchemy Help Center
You can learn more about what kind of cookies we use, why, and how from our Privacy Policy. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings in our cookie banner to change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer. For more details, check out our Privacy Policy link below.
View Privacy Policy
Strictly Necessary Cookies
These cookies are necessary for the website to function and cannot be switched off in our systems, but do not store any person information. They are usually set in response to your actions that triggers a request for services, such as setting your privacy preferences, logging in or filling forms. You can change your browser settings to alert you about these cookies, but some parts of the Website may not work.
View Cookies
There are times when you may want to fashion a locator that identifies a group of objects/elements on the screen. Consider the scenario where you want your test to iterate over all of the similar elements on the screen and perform some action or verification of each.
A simple example of this (using our demo site: Bike Shop https://bikeshop.alchemytesting.com) is the verification of product category labels on the various pages. In other words make sure on the Bicycles page, all the products have the category "Bicycles". Or, on the Accessories page, all the products have the category "Accessories".
To do this, Use the Alchemy browser in "Inspector mode"
You can formulate, type in, and test an xpath locator in the Descriptor field (green box above). One handy xpath method for accomplishing this is: contains().
The syntax for locating elements through XPath- Using contains() method can be written as:
For example: on the Bicycles page if you use the descriptor:
You will identify all the SPAN tags on the page with the class:"ast-woo-product-category".
Now, you can add this Locator to your Site in Alchemy. Then use that locator to iterate over the identified elements. See other Topics, KB articles or videos for looping or iterating over elements.
1 Votes
0 Comments
Login or Sign up to post a comment