Skip to main content
added 186 characters in body
Source Link
Floella
  • 319
  • 1
  • 7
  • 14

I'm trying to set up a maven+robot+selenium3+testNG project using Eclipse and java.

So far, I've created a maven project and added the dependencies and plugins to its pom.xml so I don't have to manually download anything. I added the following dependencies: selenium-java, selenium-server (not sure if I need it), testng, robotframework, robotframework-maven-plugin, robotframework-selenium2library-java, and also the robotframework-maven-plugin.

I also added a tests.robot file under src/test/robotframework/acceptance with this test:

*** Settings ***
Library  Selenium2Library


*** Test Cases ***
Visit google
  Open Browser  https://www.google.com  chrome
  Close Browser

However, I'm not sure how to tell robot where my chromedriver is. Currently, when I run as maven-install, I get "java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property;

I read somewhere that I should create my own keyword for that, and then use System.setProperty("webdriver.chrome.driver", "path\\chromedriver.exe"); but I don't really know wherehow to add that linecreate my own keywords in java, and how to connect itthem with robot.

I'm trying to set up a maven+robot+selenium3+testNG project using Eclipse and java.

So far, I've created a maven project and added the dependencies and plugins to its pom.xml so I don't have to manually download anything. I added the following dependencies: selenium-java, selenium-server (not sure if I need it), testng, robotframework, robotframework-maven-plugin, robotframework-selenium2library-java, and also the robotframework-maven-plugin.

I also added a tests.robot file under src/test/robotframework/acceptance with this test:

*** Settings ***
Library  Selenium2Library


*** Test Cases ***
Visit google
  Open Browser  https://www.google.com  chrome
  Close Browser

However, I'm not sure how to tell robot where my chromedriver is.

I read somewhere that I should create my own keyword for that, and then use System.setProperty("webdriver.chrome.driver", "path\\chromedriver.exe"); but I don't really know where to add that line and how to connect it with robot.

I'm trying to set up a maven+robot+selenium3+testNG project using Eclipse and java.

So far, I've created a maven project and added the dependencies and plugins to its pom.xml so I don't have to manually download anything. I added the following dependencies: selenium-java, selenium-server (not sure if I need it), testng, robotframework, robotframework-maven-plugin, robotframework-selenium2library-java, and also the robotframework-maven-plugin.

I also added a tests.robot file under src/test/robotframework/acceptance with this test:

*** Settings ***
Library  Selenium2Library


*** Test Cases ***
Visit google
  Open Browser  https://www.google.com  chrome
  Close Browser

However, I'm not sure how to tell robot where my chromedriver is. Currently, when I run as maven-install, I get "java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property;

I read somewhere that I should create my own keyword and then use System.setProperty("webdriver.chrome.driver", "path\\chromedriver.exe"); but I don't really know how to create my own keywords in java, and how to connect them with robot.

Source Link
Floella
  • 319
  • 1
  • 7
  • 14

Robot framework with java: where to put browser driver path?

I'm trying to set up a maven+robot+selenium3+testNG project using Eclipse and java.

So far, I've created a maven project and added the dependencies and plugins to its pom.xml so I don't have to manually download anything. I added the following dependencies: selenium-java, selenium-server (not sure if I need it), testng, robotframework, robotframework-maven-plugin, robotframework-selenium2library-java, and also the robotframework-maven-plugin.

I also added a tests.robot file under src/test/robotframework/acceptance with this test:

*** Settings ***
Library  Selenium2Library


*** Test Cases ***
Visit google
  Open Browser  https://www.google.com  chrome
  Close Browser

However, I'm not sure how to tell robot where my chromedriver is.

I read somewhere that I should create my own keyword for that, and then use System.setProperty("webdriver.chrome.driver", "path\\chromedriver.exe"); but I don't really know where to add that line and how to connect it with robot.