Skip to main content

Posts

Showing posts from December, 2020

Handling Multiple Windows in Citibank site

  Find the code for handling multiple windows via windows handler the steps are given in detail here on clicking on the first window a new window shall open and while you move to the new window does not mean moving driver to the 2nd window, but it will still point to parent window so how to move to child window to a parent window is defined here @Test public void test1() throws InterruptedException { System.setProperty("Webdriver.chrome.driver", "chromedriver");     WebDriver driver = new ChromeDriver();    driver.get("https://www.online.citibank.co.in/");    driver.manage().timeouts().implicitlyWait(6, TimeUnit.SECONDS);    System.out.println(driver.getTitle());    //gives you ID of current window    String pa = driver.getWindowHandle();    System.out.println(pa);    //to click on the login button which will open anew window    driver.findElement(By.xpath("//*[@title='LOGIN NOW']/img...

Handling Chrome in Mac for Automation(update off/driver path)

If you are doing Automation on chrome on your Mac system then you face few issues like . updgrade in you chrome browser which leads to updating chromedriver. I still work on chrome version 85 to disable the chrome update you need to Go to application-> search chrome driver -> Right click->show packaged content  Open contents  -> go to frameworks->Google chrome framework.framework->versions-> remove folder with name “ Current ” Its not visible in below screenshot as it already removed  This will stop updating your chrome driver  If your you want to update your chrome then search for the updated chrome driver download the version for Mac unzip  and place it in the folder where your eclipse workspace is created, to do that  First Go to eclipse Right click on the  project-> go to properties Copy the path Now press  command+shift+G . (pointing cursor in desktop) paste the path  "  /Users/priyankac/Documents/workspace"...

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...