Description: I am using following JS code line using chrome console (whose image is also attached) and the this code gives ids of opened Tabs in a page of my web application (tabs image is also attached to understand output). But Now I don't know how to use this JS code line in my automation script that I am writing using Selenium Web-driver in Java.
Code:
Array.from(document.querySelectorAll("[class*='x-tab x-unselectable x-tab-after-title x-box-item x-tab-default x-top x-tab-top x-tab-default-top x-closable x-tab-closable x-tab-default-closable x-closable-top x-tab-closable-top x-tab-default-closable-top x-icon-text-left x-tab-icon-text-left x-tab-default-icon-text-left']")).map(function(item){return item.id;})
Question:
Can anybody tell me how to use this code line in selenium Webdriver script using Java? I am using above JS code line on chrome console opened for my application and it is giving correct result.