I installed netbeans and then Selenium Client Driver and the step i have done after installing Client Driver:
- Open NetBeans IDE.
- Goto File->New Project->Categories Java and Projects Java Application and click next.
- Give the Project Name and Destination where it it will be saved and click finished.
- Right Click on project which is shown on the left side of NetBeans and select Properties 5.Add all jars with in the selenium-2.37.0 folder (selenium-2.37.0 + selenium-java-2.37.0-srcs.jar +All jar in libs folder)
After Completing this much steps also I couldn't start working on it..can anyone please tell if any other process I need to do after this, also please tell me how to start writing codes, because Iam new to webdriver
-
you should use at least selenium 2.44 jar instead of old version.Helping Hands– Helping Hands2015年05月27日 10:07:17 +00:00Commented May 27, 2015 at 10:07
-
you should also share code you have written as your first test.Helping Hands– Helping Hands2015年05月27日 10:08:08 +00:00Commented May 27, 2015 at 10:08
-
Check this steps : stackoverflow.com/questions/14974570/…Helping Hands– Helping Hands2015年05月27日 10:10:36 +00:00Commented May 27, 2015 at 10:10
-
1"I couldn't start working on it.." , what prevented you from starting working? You get errors or what?Niels van Reijmersdal– Niels van Reijmersdal2015年05月27日 11:00:12 +00:00Commented May 27, 2015 at 11:00
1 Answer 1
Instead of downloading and using your own Selenium jars I would use Maven. Maven is used as a build tool and will download any dependencies you might need, like the latest version of Selenium.
Steps:
Download & Install Netbeans with JDK at http://www.oracle.com/technetwork/java/javase/downloads/index.html (Also install JUnit with the installer)
Install Firefox
Create a new project: Maven -> Java Application
Under project files edit pom.xml and add Selenium dependency
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.45.0</version>
</dependency>
</dependencies>
Right click project-name to get a menu and select: New -> Other. Pick the JUnit Test from the Unit Tests category. Next -> Finish.
Pasted the following code to replace the JUnit test file
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class NewEmptyJUnitTest {
@Test
public void hello() {
WebDriver driver = new FirefoxDriver();
driver.get("http://sqa.stackexchange.com/questions/13213/how-to-configure-selenium-webdriver-with-netbeans");
WebElement acceptAnswerLink = driver.findElement(By.id("vote-accepted-13214"));
acceptAnswerLink.click();
driver.quit();
}
}
- Hit Ctrl-F6 to run the unit-tests
The result should be that Firefox starts opening this page and accepting this answer ;-)
Put the files on github: https://github.com/nreijmersdal/NetbeansMavenSelenium
-
Thanks for your reply ,But while doing 2nd step these much errors comingArYa– ArYa2015年05月27日 11:35:42 +00:00Commented May 27, 2015 at 11:35
-
Failed to execute goal on project application: Could not resolve dependencies for project demo.crud.mvn:application:nbm-application:1.0-SNAPSHOT: The following artifacts could not be resolved: demo.crud.mvn:crudsample:jar:1.0-SNAPSHOT, demo.crud.mvn:branding:jar:1.0-SNAPSHOT: Could not find artifact demo.crud.mvn:crudsample:jar:1.0-SNAPSHOT in netbeans (bits.netbeans.org/maven2) -> [Help 1]ArYa– ArYa2015年05月27日 11:37:55 +00:00Commented May 27, 2015 at 11:37
-
To see the full stack trace of the errors, re-run Maven with the -e switch. Re-run Maven using the -X switch to enable full debug logging. For more information about the errors and possible solutions, please read the following articles: [Help 1] cwiki.apache.org/confluence/display/MAVEN/…ArYa– ArYa2015年05月27日 11:38:02 +00:00Commented May 27, 2015 at 11:38
-
@ Niels van Reijmersdal can you please check the above problemArYa– ArYa2015年05月27日 12:13:05 +00:00Commented May 27, 2015 at 12:13
-
I dont have netbeans installed, I dont think I will have time soon to verify it my self.Niels van Reijmersdal– Niels van Reijmersdal2015年05月27日 12:23:02 +00:00Commented May 27, 2015 at 12:23