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

来源:互联网 发布:复杂网络 院士 编辑:程序博客网 时间:2024/05/16 16:22

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

FAILED: testLogInorg.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: nullBuild 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);
0 0