Skip to main content

Posts

Showing posts with the label Multiple Tabs

Tabs opening in selenium -Multiple tabs via (Keyschord)/Single tab using Context click and Robot class

  I'll be showcasing you opening multiple tabs via selenium by 2  different  method 1. the below code is used for opening multiple tabs in amazon using the Command(mac)/Control(win) + T method using Keychord, you can also use send keys using Action class but this approach does not always work , due to send keys issues with browser.   2.you have another method using "Robot class" Which is explained later steps Let's discuss first about opening multiple tans in same browser using Keys.chord Command(mac)+T method Below is the screenshot for Amazon and we are targeting the below links to get open in different tabs Here is the code for you public class MultipleTabs { WebDriver driver ; @Test public void test2() { System.setProperty( "Webdriver.chrome.driver" , "chromedriver" ); WebDriver driver = new ChromeDriver(); driver .manage().timeouts().implicitlyWait(6, TimeUnit. SECONDS ); driver .get( "https://www.amazon.in/" ); driv...