0

We are using LinkedIn sign up to use our application. But when I try automation, I face an issue finding the username and password elements. How can I fetch those elements?

Here is the code so far;

public void testUntitled() throws Exception {
    driver.get(baseUrl + "/login");
    driver.findElement(By.id("li_ui_li_gen_1393418749917_0-logo")).click();
    // ERROR: Caught exception [ERROR: Unsupported command [waitForPopUp | easyXDM_IN_Lib_li_gen_1393418780585_1_provider_popup | 30000]]
    // ERROR: Caught exception [ERROR: Unsupported command [selectWindow | name=easyXDM_IN_Lib_li_gen_1393418780585_1_provider_popup | ]]
    driver.findElement(By.id("session_key-oauthAuthorizeForm")).clear();
    driver.findElement(By.id("session_key-oauthAuthorizeForm")).sendKeys("abc@rediffmail.com");
    driver.findElement(By.id("session_password-oauthAuthorizeForm")).clear();
    driver.findElement(By.id("session_password-oauthAuthorizeForm")).sendKeys("123456");
    driver.findElement(By.name("authorize")).click();
}
Elliott Frisch
  • 198,278
  • 20
  • 158
  • 249

1 Answers1

0

You need to transfer control to the popup window after you click on the LinkedIn Logo. Then try to search for the username and password fields.

Dont forget to switch back to the main window handle after the authorization steps are done with.

Here is a way to do it - How to handle Pop-up in Selenium WebDriver using Java

Community
  • 1
  • 1
Amey
  • 8,470
  • 9
  • 44
  • 63