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.