Selenium, CssSelector : Part I (tag[attribute=’value’])

The following code snippet has been copied from this link https://wikipedia.org <span class=”lang-list-button-text jsl10n” data-jsl10n=”portal.language-button-text”>Read Wikipedia in your language </span> It indicates a button with language options. List of language supported on the Wikipedia will be opened if we click on it.I have used the CssSelector to identify the element and then clicked on it….

How to use Class Name in Selenium

I have copied the following piece of HTML from https://en.wikipedia.org/wiki/Carnegie_Mellon_University The class=”mw-logo-tagline” indicates a text near the logo of Wikipedia .If we click on the text then it will redirect us to the Home page.Here we will automate this process by class name locator. First open  the url using the get() method as below. driver.get(“https://en.wikipedia.org/wiki/Carnegie_Mellon_University”); The…

How to use Name locator in selenium.

The following html snippet has been taken from the following  link (you can inspect it there in the page) https://en.wikipedia.org/wiki/Main_Page It indicates one search box, where we can write something for the same purpose.Here  you can see the locator is Name and its given as this-  name=”search” The syntax to identify the Name locator using…

Example of ID and usage in the Selenium.

For example I have copied the following pieces of HTML from the https://www.wikipedia.org .The anchor element <a> along with the id=”js-link-box-ru” indicates one link .As from the title it says that it will redirect you to the Russian version of wikipedia. To click on the link using the id locator we can use the following…

Different locators in Selenium.

To automate the web application, such as automatically clicking on the buttons and links ,writing data to a text-box etc we need to first identify the web elements of those buttons or text-boxes and then perform the operation. We can identify those web elements using locators. Selenium web-driver can use the following locators to identify…