Selenium 2 (webdriver) Java Maven eclipse Hello world program problem
The Java "Hello world" project is converted to a maven project, which stops the error
hello everyone,
I have searched a lot in Google, but I can't find any Hello World Program (webdriver) Java Maven eclipse installation instructions for selenium 2
I have the following settings
Question:
Thank you in advance
Greetings, Vikram
Solution
Cannot reproduce
I did this (eclipse 4.3 Kepler, Oracle JDK 7u25):
>I created a new Hello World java project (right-click package Explorer – > New – > java project):
>I name it Hello world and click finish I created a new package in the SRC folder named Hello, which contains a new class HelloWorld:
>I implemented the HelloWorld class and ran it (F11):
>I convert the project to Maven project (right-click project – > configuration – > Convert to Maven project), and click finish
>I fixed the mistake Maven threw at me
It says "project build error: the value 'hello world' of 'artifactid' does not match a valid ID pattern." So I think Hello world may be invalid due to spaces I was right Removing space from artifact ID and group ID fixed build
Before:
After (don't forget to save the file with Ctrl s):
>Now, everything is working as expected The HelloWorld class still outputs the same thing at run time The project now has a slightly different folder structure (new Bin and target folders, new POM. XML file):
>I added selenium dependency Open POM XML, click the dependencies tab, click Add... And find selenium Java. Specify version 2.33 0
After clicking OK and saving the POM file, I have to wait for Maven to download all selenium's good things and dependencies, which will take some time (observe what the progress toolbar in eclipse does)
The only change is that the project structure has a new Maven dependencies project, which contains selenium and all its dependencies
>I'm ready to scroll with selenium:
When running, this will open Firefox, go to Google and finish