Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
add dependencies for webdriver java tests
Browse files Browse the repository at this point in the history
  • Loading branch information
priyaganti committed Jun 1, 2013
1 parent d55f260 commit f833d21
Show file tree
Hide file tree
Showing 12 changed files with 169 additions and 0 deletions.
46 changes: 46 additions & 0 deletions webdriver/java/Selenium2Example.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;

public class Selenium2Example {
public static void main(String[] args) {
// Create a new instance of the Firefox driver
// Notice that the remainder of the code relies on the interface,
// not the implementation.
WebDriver driver = new FirefoxDriver();

// And now use this to visit Google
driver.get("https://rockstor-iso:8443");
// Alternatively the same thing can be done like this
// driver.navigate().to("http://www.google.com");

// Find the text input element by its name
WebElement username = driver.findElement(By.id("inputUsername"));

// Enter something to search for
username.sendKeys("admin");

WebElement password = driver.findElement(By.id("inputPassword"));
password.sendKeys("admin");

WebElement submit = driver.findElement(By.id("sign_in"));

// Now submit the form. WebDriver will find the form for us from the element
submit.click();

WebElement logoutSubmit = driver.findElement(By.id("logout_user"));

logoutSubmit.click();

// Check the title of the page
System.out.println("Page title is: " + driver.getTitle());

//Close the browser
//driver.quit();
}
}

36 changes: 36 additions & 0 deletions webdriver/java/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>MySel20Proj</groupId>
<artifactId>MySel20Proj</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.33.0</version>
</dependency>
<dependency>
<groupId>com.opera</groupId>
<artifactId>operadriver</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.opera</groupId>
<artifactId>operadriver</artifactId>
<version>1.3</version>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
</project>

Binary file added webdriver/java/target/MySel20Proj-1.0.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions webdriver/java/target/classes/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
23 changes: 23 additions & 0 deletions webdriver/java/target/classes/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>MySel20Proj</name>
<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Thu May 23 16:10:27 PDT 2013
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Thu May 23 16:10:20 PDT 2013
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
Binary file not shown.
36 changes: 36 additions & 0 deletions webdriver/java/target/classes/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>MySel20Proj</groupId>
<artifactId>MySel20Proj</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.33.0</version>
</dependency>
<dependency>
<groupId>com.opera</groupId>
<artifactId>operadriver</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.opera</groupId>
<artifactId>operadriver</artifactId>
<version>1.3</version>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
</project>

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Generated by Maven
#Thu May 23 16:07:22 PDT 2013
version=1.0
groupId=MySel20Proj
artifactId=MySel20Proj
5 changes: 5 additions & 0 deletions webdriver/java/target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Generated by Maven
#Thu May 23 16:07:22 PDT 2013
version=1.0
groupId=MySel20Proj
artifactId=MySel20Proj

0 comments on commit f833d21

Please sign in to comment.