首页 > 解决方案 > 使用 selenium 和机器人框架时 chrome 中的登录问题

问题描述

我正在使用 selenium2library 和 robotsframework 使用 chrome 作为浏览器登录是手动工作的,但不是使用具有相同用户名和密码的脚本。我正在使用最新的 chrome 和 chrome 驱动程序(83 版本)。使用 selenium2Library 此外,通过脚本输入用户名和密码后,我使用 get value 从 UI 获取值并与输入值进行比较。两个值相同。然后也是在单击登录按钮后,我收到了错误的凭据错误

在通过脚本打开的浏览器中(当我暂停执行时),我可以手动输入用户名和密码,这工作正常。但是通过脚本输入值不起作用

可能是什么问题?PFB:

Open Browser    <URL>   browser=chrome  executable_path=D:\\chromedriver.exe
Sleep   30s     
Wait Until Page Contains Element    //input[@id="username"]     
Input Text  //input[@id="username"] <USERNAME?
Input Text  //input[@id="password"]     <PASSWORD>  
Press Keys  //input[@id="password"] Enter   
comment Click Element   //*[@id="sign_in"]  
Sleep   20s     
Wait Until Page Contains Element    <XPATH> timeout=30s 


Confirguration in windows:
robotframework-3.1.2
robotframework-autoitlibrary-1.2.5
robotframework-imagelibrary-0.1.1
robotframework-ride                1.7.4.1
robotframework-selenium2library    3.0.0
robotframework-seleniumlibrary     4.4.0

Chrome- 83.04
 ChromeDriver 83.0.4103.39

标签: windowsgoogle-chromeauthenticationrobotframeworkselenium2library

解决方案


推荐阅读