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

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

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.

  1. import org.openqa.selenium.By;
  2. import org.openqa.selenium.WebDriver;
  3. import org.openqa.selenium.edge.EdgeDriver;
  4. import org.sikuli.script.Screen;
  5. import org.sikuli.script.FindFailed;
  6. import org.sikuli.script.Pattern;
  7. public class HandlingUploadDownloadFiles {
  8. public static void main(String[] args) throws FindFailed {
  9. System.setProperty("webdriver.edge.driver", "D:\\Programming-Tools\\Eclipse IDE\\WebDriver\\Edge\\edgedriver_win64\\msedgedriver.exe");
  10. WebDriver driver = new EdgeDriver(); // Instantiate driver object
  11. driver.get("https://www.ilovepdf.com/pdf_to_word"); // Open link
  12. driver.manage().window().maximize(); // Maximize window
  13. driver.findElement(By.xpath("//a[@id='pickfiles']")).click();
  14. String filePath = "D:\\Projects\\Test Automation\\AutomationPractice\\AutomationPractice\\files\\";
  15. Screen screen = new Screen();
  16. Pattern inputTextField = new Pattern(filePath+"InputTextField.png");
  17. Pattern openButton = new Pattern(filePath+"OpenButton.png");
  18. screen.wait(inputTextField, 10);
  19. screen.type(inputTextField, filePath+"SampleFile.pdf");
  20. screen.click(openButton);
  21. }
  22. }

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.

  1. import org.openqa.selenium.By;
  2. import org.openqa.selenium.WebDriver;
  3. import org.openqa.selenium.edge.EdgeDriver;
  4. import org.sikuli.script.Screen;
  5. import org.sikuli.script.FindFailed;
  6. import org.sikuli.script.Pattern;
  7. public class HandlingUploadDownloadFiles {
  8. public static void main(String[] args) throws FindFailed {
  9. System.setProperty("webdriver.edge.driver", "D:\\Programming-Tools\\Eclipse IDE\\WebDriver\\Edge\\edgedriver_win64\\msedgedriver.exe");
  10. WebDriver driver = new EdgeDriver(); // Instantiate driver object
  11. driver.get("https://www.ilovepdf.com/pdf_to_word"); // Open link
  12. driver.manage().window().maximize(); // Maximize window
  13. driver.findElement(By.xpath("//a[@id='pickfiles']")).click();
  14. String filePath = "D:\\Projects\\Test Automation\\AutomationPractice\\AutomationPractice\\files\\";
  15. Screen screen = new Screen();
  16. Pattern inputTextField = new Pattern(filePath+"InputTextField.png");
  17. Pattern openButton = new Pattern(filePath+"OpenButton.png");
  18. screen.wait(inputTextField, 10);
  19. screen.type(inputTextField, filePath+"SampleFile.pdf");
  20. screen.click(openButton);
  21. }
  22. }

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.

  1. <dependency>
  2. <groupId>com.sikulix</groupId>
  3. <artifactId>sikulixapi</artifactId>
  4. <version>2.0.4</version>
  5. </dependency>
英文:

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

  1. &lt;dependency&gt;
  2. &lt;groupId&gt;com.sikulix&lt;/groupId&gt;
  3. &lt;artifactId&gt;sikulixapi&lt;/artifactId&gt;
  4. &lt;version&gt;2.0.4&lt;/version&gt;
  5. &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:

确定