Exception & Issue for Selenium

本文档用于记录在使用Selenium做自动化测试时遇到的一些问题及可行(可能)的解决方法:


Exception[2017/9/25]:org.openqa.selenium.SessionNotCreatedException

Solution:检查GeckoDriver的路径设置,是否正确启动。


Exception[2017/9/25]:ElementNotInteractableException

click some element not work - 某些元素的点击操作不好用。

1.使用Action click

Actions actions = new Actions(driver);
actions.moveToElement(element).click().build().perform();

2.使用JS click

JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].click();", element);

Exception[2017/9/30]:WebDriverException: Reached error page: about:neterror dnsNotFound
因为网站引用了youtube.com上面的内容,无法访问。所以,报了dns错误。

Issue[2017/9/25]:Stop Firefox crash report dialog - 停止Firefox弹出crash report窗口

work around: Turn Off the Error Dialog Through The Group Policy Editor
https://www.raymond.cc/blog/disable-program-has-stopped-working-error-dialog-in-windows-server-2008/


Firefox properties settingnot work, but can read.there:
https://developer.mozilla.org/en-US/docs/Environment_variables_affecting_crash_reporting


Issue[2017/9/25]:OFF GeckoDriver log - 关掉GeckoDriver Log

为GeckoDriver设置启动参数:

ECHO Starting geckodriver: %0 %*
%cd%\BrowserDrivers\geckodriver-v0.18.0-win64\geckodriver.exe --log fatal %* > NUL 2>&1



Issue[2017/9/25]:driver.manage().window().maximize();not work well

在Selenium3.5.3中,该方法没有判断当前窗口的大小,只是点击了最大化按钮。可能是个Bug

Issue[2017/9/25]:JavascriptLibrary:

com.thoughtworks.selenium.webdriven.JavascriptLibrary

该方法已经从jar文件中删除。


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值