0

So I start with a login URL say ("https://LOGIN-URL.com"), I send key values of login credentials with the send keys method, after a few seconds, the credentials are validated and new URL loads ("https://HOME-PAGE.com") with the home page, where I will have to perform some action and then click a button to move onto the next page with a different URL like ("https://transactions-tester123.com")

how do i achecve this with Java Selenium UI automation?

Below i have attached code where i am able to get till the login credentials part, but unable to perform actions in the new URL

        driver.get("https://LOGIN-URL.com");
        driver.manage().window().maximize();
        
        System.out.println(" User trying to login");
        driver.findElement(By.xpath("//input[@id='username']")).sendKeys("hello");
        driver.findElement(By.xpath("//input[@id='password']")).sendKeys("password");
        driver.findElement(By.xpath("//span[@id='ui-id-44']")).click();
        System.out.println("Login successful");
        
        System.out.println("Now user in Home Page");
        
PSR
  • 249
  • 1
  • 10
  • Please elaborate what do you mean with 'handle'. – pburgr Jan 11 '22 at 14:09
  • Can you please confirm if after the login is validated, the home & transactions pages are opened on the same browser window & tab? If yes, then you can continue adding the locator strategies and script on to the same file and it will work as expected. – Bipin Kumar Chaurasia Jan 11 '22 at 18:32
  • Yes, same browser, same window, same tab... only the URL changes ... nothing else – PSR Jan 12 '22 at 09:37

1 Answers1

0

try loading same page/home page/refresh