Showing posts with label Xpath Tutorials. Show all posts
Showing posts with label Xpath Tutorials. Show all posts

SelectorsHub is XPath, JSPath, cssSelector tool and it is very easy to understand and use. Earlier we learned how to install SelectorsHub in different browsers and basic features like how to get XPath or cssSelector of any web element to use it in selenium webdriver test script, using advanced featured from chrome devtool. I hope it has helped you lot to kick start learning it. Now we will look at few more features of SelectorsHub.

We have used many different tools and methods to find XPath and CSS selectors for selenium webdriver. But SelectorsHub is Next generation XPath and CSS selectors which is invented and created by Sanjay Kumar. It is very smart and intelligent IDE using which you can build XPath and CSSSelectors within 5 seconds without loosing your XPath and CSS selector writing skill for selenium WebDriver. It is supported in almost all popular browsers like Chrome, Safari, Firefox, Edge and Opera. It has so many features which we haven't seen in any other XPath and CSS Selectors IDE. It is free tool and save lot of your time. Earlier we had learnt ChroPath to find XPath or CSS Selectors of element.

In this post, We will learn how to install SelectorsHub in different browsers and usage of it's different features.

Earlier we learnt about how to find XPath or CSS selector using Chrome Devtool to use it in selenium webdriver. ChroPath have same function with few additional feature which makes it more popular in selenium webdriver universe. Here i am presenting step by step guide to retrieve XPath or CSS selector of any web element using ChroPath chrome extension. Also we will look at few more useful features of ChroPath.

You can use SelectorsHub to Find XPath and CSS Selector.

Install ChroPath in Chrome
Before learning usage, You need to Install ChroPath in your chrome browser if it is not already installed. After Installation, Refresh your web page and it is ready to use now.

Finding XPath or CSS selector is very crucial task for selenium webdriver test script preparation and so google chrome has made it very easy for all and specially selenium users. There are many different chrome extensions available which provides this feature. But Google chrome's inbuilt Chrome Devtool is very easy to use. It has many other features as well but we will look at only XPath and CSS selector finder for now. Let's look it step by step.

Finding XPath/CSS selector of web element in chrome

Step 1 : First of all, Open your web page in google chrome browser. I will use for this example. Here, we are going to find XPath and CSS selector of radio button with label Male.

Finding XPath of web element in chrome

Normalize-space is very useful function in XPath when you build it with reference of some string or keyword to use it webdriver script and it has leading or trailing intermediate repeating white space. Normalize-space will strip such unwanted space or white space. In selenium webdriver, very often we use keywords reference in building xpath. If there is not any good reference to build xapth then it is mandatory to use such keywords as reference.

You can look at my post describing different ways to build xpath .

Here i am presenting one example where we will use normalize-space function to build xpath and use it in selenium webdriver test script.

To understand how to use "storeXpathCount" command, you must be aware about xpath. You can read xpath tutorials for selenium ide in my previous post if you are not aware about what is the xpath of element and how to retrieve it manually. "storeXpathCount" command is useful to calculate and store number of

Xpath in selenium is close to must required. XPath is element locator and you need to provide xpath during selenium test script creation. You need to provide any element locator(like id, name, css path, xpath etc.) in target column of selenium IDE software testing tool's window to locate that specific element to perform some action on it and you are already aware about that. In previous post, we have learn about how to identify element id or name of software web application's element . If you have worked with selenium IDE software testing tool then you knows that sometimes elements does not contains id or name. Locating element by Xpath in selenium is the another way of locating element and you can use it as a alternative of id or name of element.