Tag: headless browser

在Jenkins haedless浏览器中:org.openqa.selenium.WebDriverException:与远程浏览器通信时出错。 它可能已经死了

嗨,我正在使用Selenium Web驱动程序和Java在Jenkins无头浏览器上执行脚本。 运行两三个脚本之后我得到以下错误这个问题我观察者当我将在一次运行时运行多个脚本但是当我执行单个脚本时它不会通过任何错误。 请帮我解决这个问题。 以下是错误代码。 org.openqa.selenium.WebDriverException: Error communicating with the remote browser. It may have died. Build info: version: ‘2.51.0’, revision: ‘1af067d’, time: ‘2016-02-05 19:15:17’ System info: host: ‘devui1.pdx.aws’, ip: ‘127.0.0.1’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘2.6.32-573.7.1.el6.x86_64’, java.version: ‘1.7.0_95’ Driver info: driver.version: EventFiringWebDriver Session ID: b825d792-ea66-4422-9b19-fcbb29a0cb95 Capabilities [{platform=LINUX, acceptSslCerts=true, javascriptEnabled=true, cssSelectorsEnabled=true, databaseEnabled=true, browserName=firefox, handlesAlerts=true, nativeEvents=false, […]

Selenium Web驱动程序:findElement(By.name …和无头浏览器

我正在尝试遵循Selenium Webdrive教程 http://www.toolsqa.com/selenium-webdriver/headless-browser-testing-selenium-webdriver/ 有一个简单的测试,这里是你的步骤: 打开网页http://google.com 获取页面标题。 搜索’Selenium’ 再次检查页面标题。 从类代码示例开始,这里是您的代码 package headlessBrowser; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.htmlunit.HtmlUnitDriver; public class TestOne { public static void main(String[] args) { // Declaring and initialising the HtmlUnitWebDriver HtmlUnitDriver unitDriver = new HtmlUnitDriver(); // open google.com webpage unitDriver.get(“http://google.com”); System.out.println(“Title of the page is -> ” + unitDriver.getTitle()); // find the […]

HtmlUnit API for Java(无头浏览器)中的问题?

我正在使用HtmlUnit无头浏览器来浏览这个网页 (你可以看到网页以更好地理解这个问题)。 我已将select的值设置为“1” http://sofzh.miximages.com/java/14m70up.jpg 通过以下命令 final WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_7); try { // Configuring the webClient webClient.setJavaScriptEnabled(true); webClient.setThrowExceptionOnScriptError(false); webClient.setCssEnabled(true); webClient.setUseInsecureSSL(true); webClient.setRedirectEnabled(true); webClient.setActiveXNative(true); webClient.setAppletEnabled(true); webClient.setPrintContentOnFailingStatusCode(true); webClient.setAjaxController(new NicelyResynchronizingAjaxController()); // Adding listeners webClient.addWebWindowListener(new com.gargoylesoftware.htmlunit.WebWindowListener() { public void webWindowOpened(WebWindowEvent event) { numberOfWebWindowOpened++; System.out.println(“Number of opened WebWindow: ” + numberOfWebWindowOpened); } public void webWindowContentChanged(WebWindowEvent event) { } public void […]

无头浏览器,支持java的完整javascript

我一直在使用HtmlUnit(开发人员做得很好)作为我之前的一些应用程序的无头浏览器,但javascript支持不适用于我的下一个应用程序将访问的某个网站。 我听说过Python的QtWebKit绑定,但我的应用程序是Java,还是WebKit或QtWebKit的Java绑定? 有没有人知道一个良好的无头浏览器的Java与完整的JavaScript支持?