Useful Tools and Plugins in Selenium
Useful Tools and Plugins in selenium will discuss about some of the useful tools or plugins which are very helpful while writing the automation scripts using selenium webdriver. One of the tedious and time taking tasks in the selenium webdriver is to identify the element on the web page. For this we need to use locators. If we have IDs to all the locators then it is super easy to write the locator for each and every element. But unfortunately developers will not put the IDs to the elements and it is not possible to put the IDs to all the elements as some of the elements will generate dynamically.
But as an automation tester while writing/capturing the scripts using selenium then it is mandatory to find the locator of each and every element which we want to interact. If we are very good at writing the XPath or CSS Selector though it will take so much time to capture the locators. Each browser has its own plug ins to find the elements but easiest and powerful plugins are available with Firefox browser.
Below are the plugins which are very helpful to find the elements and co-ordinates:
- Firebug
- Firepath
- WebDriver Element Locator
- MeasureIt
FireBug:
This is most popular and powerful web development tool. It is used to inspect the HTML and modify style and layout in real time. But in selenium we will use this to inspect the elements on the web page to get the locator. It will show the HTML written behind the web page in a structured manner and it will highlight the particular element which you inspected.
You can get more information and you can download this plugin from this link. Apart from this you can directly go to the Add-ons > Extensions of the firefox and search for the firebug from the search box available here and can install. Need to restart the firefox to effect the changes.
FirePath:
Firebug only highlights the element but it will not give the locator value. But using Firepath we can get the locator value directly without writing anything. But these may not be accurate as it uses its own logic to construct the locator. To write effective locators we can customize the firepath given value. Most of the times we can directly use the value which is provided by the firepath. And sometimes we need to change the value of this according to the situation.
You can get more information and you can download this plugin from this link. Apart from this you can directly go to the Add-ons > Extensions of the firefox and search for the firepath from the search box available here and can install. Need to restart the firefox to effect the changes.
Firepath will give XPath and CSS Selector values directly when you inspect the element using firebug.
WebDriver Element Locator:
This plugin is also used to find the locators of the particular element on the web page. This is combination of Firepath and Firebug we can say as if you right click on any element on the webpage it will give so many language(i.e. Java, C#, Ruby and Python) options along with XPath. You just right click on any element and then you can get the XPath of that particular element and you can copy in the code. It will make your life more easy.
You can get more information and you can download this plugin from this link. Apart from this you can directly go to the Add-ons > Extensions of the firefox and search for the WebDriver Element Locator from the search box available here and can install. Need to restart the firefox to effect the changes.
MeasureIt:
This plugin is used to find the coordinates of the particular element. Sometimes in selenium locators may not work or may not possible to get those. In those situations we will depend upon the coordinates. For ex, if you want drag and drop particular element; sometimes destination might be dynamic then we can use the coordinates to find the area where we want to drop the element.
You can get more information and you can download this plugin from this link. Apart from this you can directly go to the Add-ons > Extensions of the firefox and search for the measureit from the search box available here and can install. Need to restart the firefox to effect the changes.
These are the basic and very helpful plugins while automating the applications using selenium. We have so many other alternatives for different browsers but these are the very suitable and helpful plugins and it will make your automation life easy 🙂
Please watch the YouTube video for this blog for better understanding.