Tag: selenium

Selenium错误 – 对远程WebDriver的HTTP请求在60秒后超时

我已经使用了几个月的Selenium,我们正在使用它来自动化我们的一些内部testingstream程。 脚本一直没有问题。 我最近使用FF 27.01升级到C#2.40.0 webdriver,我们的脚本现在在随机失败,出现以下错误。 [Portal.SmokeTest.SmokeRunTest.Booking] TearDown method failed. OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL htt(p)://localhost:7055/hub/session/56e99e88-ba17-4d12-bef1-c6a6367ccc2f/element timed out after 60 seconds. —-> System.Net.WebException : The operation has timed out TearDown : OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL htt(p)://localhost:7055/hub/session/56e99e88-ba17-4d12-bef1-c6a6367ccc2f/window timed out after 60 seconds. […]

Firefox WebDriver不支持Firefox 32

我刚刚更新到Firefox 32,当我试图运行我的Selenium Webdrivertesting时,我得到以下 Failed to start up socket within 45000 ms. Attempted to connect to the following addresses: 127.0.0.1:7055 OpenQA.Selenium.WebDriverException was unhandled by user code HResult=-2146233088 Message=Failed to start up socket within 45000 ms. Attempted to connect to the following addresses: 127.0.0.1:7055 Source=WebDriver StackTrace: at OpenQA.Selenium.Firefox.FirefoxDriverServer.ConnectToBrowser(TimeSpan timeToWait) at OpenQA.Selenium.Firefox.FirefoxDriverServer.Start() at OpenQA.Selenium.Firefox.FirefoxDriverCommandExecutor.Execute(Command commandToExecute) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, […]

未知错误:Chrome无法启动:exception退出(驱动程序信息:chromedriver = 2.9

我试图在Debian 7上运行Seleniumtesting,但没有成功。 错误是: unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.9.248316,platform=Linux 3.2.0-4-686-pae x86) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 60.55 seconds Build info: version: '2.33.0', revision: '4ecaf82108b2a6cc6f006aae81961236eba93358', time: '2013-05-22 12:00:17' System info: os.name: 'Linux', os.arch: 'i386', os.version: '3.2.0-4-686-pae', java.version: '1.7.0_25' Driver info: org.openqa.selenium.chrome.ChromeDriver 我有chromedriver 29在Debian […]

如何修复seleniumWebDriverException:浏览器似乎退出之前,我们可以连接?

我在我的centos6.4服务器上安装了firefox和xvfb来使用selenium webdriver。 但是,当我运行代码时,我得到一个错误。 from selenium import webdriver browser = webdriver.Firefox() 错误 selenium.common.exceptions.WebDriverException: Message: 'The browser appears to have exited before we could connect. The output was: None' 我读了一些相关的页面在stackoverflow和有人build议删除tmp文件夹中的所有文件,所以我做到了。 但是,它仍然不起作用。 任何人都可以请给我一个帮助? 先谢谢你! 编辑 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/firefox/webdriver.py", line 59, in __init__ self.binary, timeout), File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/firefox/extension_connection.py", line 47, […]

PhantomJS很长一段时间说“现在开始asynchronous会话清理阶段”

这是一个截图: task : Codeception PHP Testing Framework v1.6.2 Powered by PHPUnit 3.7.19 by Sebastian Bergmann. Suite selenium_acceptance started Trying to see the welcome page of newweather (welcomeCept.php) issue : it sits as it is and waiting for phantomJS to respond and below is what phantomJS screen is showing : [INFO – 2014-03-13T01:42:51.575Z] SessionManagerReqHand – _postNewSessionCommand […]

如何让selenium等待Ajax响应?

我如何让selenium等待像日历小部件加载? 现在我只是在将testing用例导出到junit程序之后执行Thread.sleep(2500) 。

selenium网格:MaxSessions与MaxInstances

我想知道是否有人能够提出一个Selenium问题,让我们有点头痛。 我们对Selenium Grid的MaxSession和MaxInstances的含义感到困惑。 我们认为MaxSession是可以在单个节点上运行的testing会话的总数。 而且我们也认为MaxInstances是一个testing可以打开的浏览器总数。 或者MaxInstances是可用于该节点的浏览器总数? 我们正在使用的命令是: java -Xrs -jar selenium-server.jar -role node -port 44506 -hub http://localhost:44500 /grid/register -firefoxProfileTemplate SeleniumProfile -timeout 300000 -browser "browserName=firefox,maxInstances=10,platform=ANY,seleniumProtocol=WebDriver" -browser "browserName=chrome,maxInstances=10,platform=ANY,seleniumProtocol=WebDriver" 我们认为我们使用我们的节点(上面)的方式默认是5个并发testing会话。 每个testing有20个可用的浏览器吗? 还是每个testing会话共享池中的20个浏览器(10个chrome / 10 FF) – 与其他testing会话?

在Selenium中捕获JavaScript错误

有没有一种方法来捕获在Selenium DOM中发生的错误,并可能标记为相同的页面中的错误? 举个简单的例子,假设我试图在一个不存在的HTML控件上绑定一个事件,我的浏览器会抛出一个错误: element abcd not found in the console. 现在,如果我想要相同的错误,我的seleniumtesting失败,并显示在浏览器上的消息显示为错误消息。 有没有可能做这样的事情?

如何检查WebDriver是否可见

使用Selenium 2.0a2的WebDriver ,我无法检查元素是否可见。 WebDriver.findElement返回一个WebElement ,不幸的是它没有提供一个isVisible方法。 我可以通过使用WebElement.clear或WebElement.click来解决这个问题,两者都抛出一个ElementNotVisibleException ,但是这感觉非常肮脏。 任何更好的想法?

如何等待,直到页面加载与seleniumfor Python?

我想抓取一个由无限滚动实现的页面的所有数据。 下面的python代码工作。 for i=1:100 driver.execute_script("window.scrollTo(0, document.body.scrollHeight);") time.sleep(5) 这意味着每次向下滚动到底部时,我需要等待5秒钟,这通常足以让页面完成加载新生成的内容。 但是,这可能不是时间效率。 该页面可能会在5秒内完成加载新内容。 我怎样才能检测页面是否完成加载新的内容,每次我向下滚动? 如果我能检测到这一点,我可以再次向下滚动,看到更多的内容,一旦我知道页面完成加载。 这是更省时。