Please find all the important SelectorsHub links here-
Note: Use SelectorsHub to handle shadow dom elements. It will give complete information what is not possible and what is possible along with script.
To open the automated browser window with SelectorsHub follow these steps-
1. Copy the SelectorsHub chrome store url.
2. Open a new tab with url http://crxextractor.com/ and click on ‘Start for Free’ then paste the SelectorsHub chrome store url given in step1 into the textfield. Click on download the crx to your local.
3. Now add the below lines of code into your script before initiating the WebDriver instance in your script:
ChromeOptions options = new ChromeOptions();
options.addExtensions(new File(“path of the crx extension on your local machine”));
driver = new ChromeDriver(options);
5. That’s all. SelectorsHub extension is now enabled…
Writing own XPath is very important & must have skill for every automation tester.
Apart from how to write XPath, it is very important to learn where to write and verify XPath. Most of the people are not aware that “DevTools is not the right platform to verify XPath & Selectors because it doesn’t support shadow DOM, nested iframe and it also includes string matches in total results.” Learn more about it here with real time scenario.
SelectorsHub is the standard and the very first smart editor to write and verify XPath & CSS Selector. …
DevTools Console/Find is not the right platform to verify XPath & CSS Selector because it doesn’t provide the right info for XPath & CSS Selectors.
We never talked about this basic concepts and always considered DevTools as standard platform due to lack of innovations.
SelectorsHub is the standard and right platform to write and verify the XPath & CSS Selector.
Please watch this live demo & learn about this concept and spread the awareness.
SelectorsHub is the Next Gen locators tool to generate, write and verify the XPath and cssSelectors. It’s a FREE browser extension available for all browsers.
Though it’s very simple to use SelectorsHub but sometimes for few users these issues comes.
In fact none of these are issues of SelectorsHub, most of them are because of browser settings.
Don’t worry here is the solution for every issue related to SelectorsHub and hardly it will take 30sec for you to fix it.
We can’t access the shadow dom elements like other web elements.
Like driver.findElement(..) can’t be used directly to handle shadow dom elements.
//This Element is inside single shadow DOM.
String cssSelectorForHost1 = “book-app[apptitle=’BOOKS’]”;
WebElement shadowDomHostElement = driver.findElement(By.cssSelector(“book-app[apptitle=’BOOKS’]”));
Many a times we found certain dropdown and auto suggest elements which disappear immediately as we click or right click.
As these elements immediately disappear so it becomes almost impossible to inspect and if we try through DevTools it takes too much time.
But now SelectorsHub has made it possible with its debugger feature.
With help of SelectorsHub’s debugger feature any dynamic element could be inspected just in few seconds.
Checkout here “How to use SelectorsHub’s Debugger Feature to inspect any dynamic and invisible web element?”
Download Link of SelectorsHub — https://selectorshub.com/
Creator of SelectorsHub & ChroPath | Speaker | Blogger | Automation Passionate