简体   繁体   English

如何处理linkedIn授权使用Java在Selenium Webdriver中弹出?

[英]How to Handle linkedIn authorization Pop up in selenium webdriver using Java?

We are using LinkedIn sign up to use our application. 我们正在使用LinkedIn进行注册以使用我们的应用程序。 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();
}

You need to transfer control to the popup window after you click on the LinkedIn Logo. 单击LinkedIn徽标后,需要将控制权转移到弹出窗口。 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 这是一种实现方法- 如何使用Java处理Selenium WebDriver中的弹出窗口

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Java处理Selenium WebDriver中的弹出窗口 - How to handle Pop-up in Selenium WebDriver using Java 如何使用JAVA在Selenium Webdriver的Internet Explorer中处理服务器身份验证弹出窗口? - How can i handle Server authentication pop-up in Internet Explorer in Selenium Webdriver using JAVA? 如何使用Java处理Selenium Webdriver中下一个选项卡中弹出的所需身份验证? - How to handle authentication required pop up in next tab in selenium webdriver using java? 如何使用带有Java的Selenium Webdriver处理允许弹出的Firefox插件 - How do I handle allow pop-up of plug-in for firefox using Selenium Webdriver with Java 出现不可预测的弹出窗口-如何使用Selenium(Java)处理此问题? - Unpredictable Pop up appears - How to handle this using Selenium (Java)? 如何处理Selenium Webdriver / Java中Amazon网站上弹出的鼠标悬停等级 - How to handle mouse over rating pop up in Amazon website in Selenium Webdriver/Java 在 Selenium java 中如何处理弹出窗口 - In Selenium java how to handle the pop up 如何处理弹出 windows Java Selenium? - How to handle pop up windows Java Selenium? 如何处理 Selenium 弹出 java - How to handle the Selenium Pop-up with java 如何处理硒webdriver中具有空白ID的弹出窗口? - How to handle pop up windows with blank id in selenium webdriver?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM