我試圖運行簡單的Java Selenium代碼,但出現此錯誤 - 任何人都可以幫我弄清楚它嗎?Java.net中的java.net.MalformedURLException Selenium代碼
import org.openqa.selenium.*;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class test
{
public static void main(String[] args)
{
stem.setProperty("webdriver.chrome.driver","D:/apache-jmeter-3.1/bin/chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.com/");
String Title = driver.getTitle();
//compare the actual title of the page with the expected one
if (Title.contentEquals("Google"))
{
System.out.println("Test Passed!");
}
else
{
System.out.println("Test Failed");
}
driver.close();
}
}
這意味着**鏈接失效**。什麼是URL? –
我已通過鏈接** driver.get(「http://google.com」); ** –
@PrashanthNagendra您能否考慮向我們展示您的作品? – DebanjanB