您的位置:首页 > 其它

使用WebDriver的过程中遇到的一个Bug

2016-05-03 17:56 603 查看
在使用WebDriver的过程中遇到一个Bug,如下:



在进行登录的过程中使用”(\n)” 这个字符串作为密码,再点击弹出的警告框(WebDirver会直接报错),错误信息如下(目前还没有找到解决办法):

FAILED: testLogIn
org.openqa.selenium.UnhandledAlertException: unexpected alert open: {Alert text : 用户名与密码不匹配}
(Session info: chrome=50.0.2661.94)
(Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3 milliseconds: null
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40'
System info: host: '', ip: '', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_80'
*** Element info: {Using=xpath, value=//*[@id='subbtn']}
Session ID: 96557e9b87db85fbba7f5f8b81259a5e


private String wrongPwd = "(\n)";
private String wrongUser = "(&%?)";

chrome.type(Shop.logIn_User,wrongUser);
chrome.type(Shop.logIn_Pwd,wrongPwd);
chrome.click(Shop.logIn_Submit);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: