Possible causes are invalid address of the remote server or browser start-up failure.

huangapple go评论66阅读模式
英文:

Possible causes are invalid address of the remote server or browser start-up failure

问题

I use Eclipse IDE, selenium-java v4.8.3, and after I added the SikuliX API version 2.0.5 in my dependencies, I encountered this error

>Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: >Could not start a new session. Possible causes are invalid address of the >remote server or browser start-up failure.

I already checked the compatibility of my edge browser and edge webdriver, also the file path of my msedgedriver.exe. I also tried to use ChromeDriver, and restart my PC. However, I still have this error.

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.sikuli.script.Screen;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Pattern;

public class HandlingUploadDownloadFiles {

	public static void main(String[] args) throws FindFailed {

		System.setProperty("webdriver.edge.driver", "D:\\Programming-Tools\\Eclipse IDE\\WebDriver\\Edge\\edgedriver_win64\\msedgedriver.exe");

		WebDriver driver = new EdgeDriver(); // Instantiate driver object
		driver.get("https://www.ilovepdf.com/pdf_to_word"); // Open link
		driver.manage().window().maximize(); // Maximize window

		driver.findElement(By.xpath("//a[@id='pickfiles']")).click();

		String filePath = "D:\\Projects\\Test Automation\\AutomationPractice\\AutomationPractice\\files\\";

		Screen screen = new Screen();

		Pattern inputTextField = new Pattern(filePath+"InputTextField.png");
		Pattern openButton = new Pattern(filePath+"OpenButton.png");

		screen.wait(inputTextField, 10);
		screen.type(inputTextField, filePath+"SampleFile.pdf");
		screen.click(openButton);
	}
}

Possible causes are invalid address of the remote server or browser start-up failure.

英文:

I use Eclipse IDE, selenium-java v4.8.3, and after I added the SikuliX API version 2.0.5 in my dependencies, I encountered this error

>Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: >Could not start a new session. Possible causes are invalid address of the >remote server or browser start-up failure.

I already checked the compatibility of my edge browser and edge webdriver, also the file path of my msedgedriver.exe. I also tried to use ChromeDriver, and restart my PC. However, I still have this error.

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.sikuli.script.Screen;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Pattern;



public class HandlingUploadDownloadFiles {

	public static void main(String[] args) throws FindFailed {
		
		System.setProperty("webdriver.edge.driver", "D:\\Programming-Tools\\Eclipse IDE\\WebDriver\\Edge\\edgedriver_win64\\msedgedriver.exe");
		
		WebDriver driver = new EdgeDriver(); // Instantiate driver object
		driver.get("https://www.ilovepdf.com/pdf_to_word"); // Open link
		driver.manage().window().maximize(); // Maximize window
		
		driver.findElement(By.xpath("//a[@id='pickfiles']")).click();
		
		String filePath = "D:\\Projects\\Test Automation\\AutomationPractice\\AutomationPractice\\files\\";
		
		Screen screen = new Screen();
		
		Pattern inputTextField = new Pattern(filePath+"InputTextField.png");
		Pattern openButton = new Pattern(filePath+"OpenButton.png");
		
		screen.wait(inputTextField, 10);
		screen.type(inputTextField, filePath+"SampleFile.pdf");
		screen.click(openButton);
		
		
		
	}

}

Possible causes are invalid address of the remote server or browser start-up failure.

答案1

得分: 1

I ran your code by just changing the version of sikuli to below, and it worked fine.

<dependency>
	<groupId>com.sikulix</groupId>
	<artifactId>sikulixapi</artifactId>
	<version>2.0.4</version>
</dependency>
英文:

I ran your code by just changing the version of sikuli to below, and it worked fine.

&lt;dependency&gt;
	&lt;groupId&gt;com.sikulix&lt;/groupId&gt;
	&lt;artifactId&gt;sikulixapi&lt;/artifactId&gt;
	&lt;version&gt;2.0.4&lt;/version&gt;
&lt;/dependency&gt;

huangapple
  • 本文由 发表于 2023年4月6日 23:20:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/75951172.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定