我试图用selenium-java编写我的第一个程序,但是在一个只有几行代码的短程序中,我得到了以下错误:
线程"main“中的异常:尝试从org.openqa.selenium.firefox.FirefoxBinary.locateFirefoxBinariesFromPlatform(FirefoxBinary.java:418) at org.openqa.selenium.firefox.FirefoxBinary.(FirefoxBinary.java:108) at java.util.Optional.orElseGet(未知源)的org.openqa.selenium
我的selenium代码不运行。一直向我抛出以下错误:
Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: 'unknown', revision: 'unknown
我试图在我的MacBook上打开google页面
package practice;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Test {
public static void main(String[] args) {
System.setProperty("webdriver.firefox.marionette", "/Users/swapnilasingh/eclipse
我使用Selenium 2.35.0并配置以下代理设置:
DesiredCapabilities cap = new DesiredCapabilities();
org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
proxy.setHttpProxy(proxyStr).setFtpProxy(proxyStr).setSslProxy(proxyStr);
cap.setCapability(CapabilityType.PROXY, proxy);
driver = new FirefoxDriver(f
Exception in thread "main" java.lang.NoSuchMethodError: org.openqa.selenium.logging.LocalLogs.getNullLogger()Lorg/openqa/selenium/logging/LocalLogs;
at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.<init>(FirefoxDriver.java:332)
at org.openqa.selenium.firefox.Fi
我正在尝试使用Selenium WebDriver从eclipse中加载火狐浏览器。控制台窗口显示“正在启动Firefox”,但没有任何反应。可能出了什么问题?
package testSanity;
import com.openqa.selenium.FirefoxDriver;
import com.openqa.selenium.WebDriver;
public class testAdminLogin {
public static void main(String[] args) {
// TODO Auto-generated method stu
我想要一条H1短信。该页面将从“标记”转换为“HTML”。当我使用下面的代码使用XPath获取文本时:
element = driver.find_element(xpath: '/html/body/div[3]/div[1]/h1')
element.text
我正在犯错误:
<driver.find_element(xpath: '/html/body/div[3]/div[1]/h1')
Selenium::WebDriver::Error::NoSuchElementError: no such element: Unable to locate
我正在使用这个代码,它给了我这个错误:
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableMap
at org.openqa.selenium.firefox.FirefoxDriver.<clinit>FirefoxDriver.java:108)
at Selenium_1.main(Selenium_1.java:13)
Caused by: java.lang.ClassNotFou
当我试图运行以下代码时,总是会得到错误:
错误:(20,55) java: void无法取消引用
我读过一些现有的文章,但它们似乎没有意义.也就是说,我试图在搜索方法中添加一个返回值,但这并没有改变任何事情.
package com.Selenium_intelliJ;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Main {
public static voi