This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dependencies for webdriver java tests
- Loading branch information
1 parent
d55f260
commit f833d21
Showing
12 changed files
with
169 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
6 changes: 6 additions & 0 deletions
6
webdriver/java/target/classes/.settings/org.eclipse.jdt.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
5 changes: 5 additions & 0 deletions
5
webdriver/java/target/classes/.settings/org.eclipse.m2e.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
5 changes: 5 additions & 0 deletions
5
webdriver/java/target/classes/target/maven-archiver/pom.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |