commit
79d872a7c6
12 changed files with 338 additions and 0 deletions
-
40.classpath
-
23.project
-
8.settings/org.eclipse.jdt.core.prefs
-
4.settings/org.eclipse.m2e.core.prefs
-
45pom.xml
-
37src/test/java/userLogin/Buttons.java
-
125src/test/java/userLogin/HomePage.java
-
4target/classes/META-INF/MANIFEST.MF
-
7target/classes/META-INF/maven/petreg.org/PetRegistrations/pom.properties
-
45target/classes/META-INF/maven/petreg.org/PetRegistrations/pom.xml
-
BINtarget/test-classes/userLogin/Buttons.class
-
BINtarget/test-classes/userLogin/HomePage.class
@ -0,0 +1,40 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<classpath> |
|||
<classpathentry kind="src" output="target/classes" path="src/main/java"> |
|||
<attributes> |
|||
<attribute name="optional" value="true"/> |
|||
<attribute name="maven.pomderived" value="true"/> |
|||
</attributes> |
|||
</classpathentry> |
|||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> |
|||
<attributes> |
|||
<attribute name="maven.pomderived" value="true"/> |
|||
<attribute name="optional" value="true"/> |
|||
</attributes> |
|||
</classpathentry> |
|||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> |
|||
<attributes> |
|||
<attribute name="optional" value="true"/> |
|||
<attribute name="maven.pomderived" value="true"/> |
|||
<attribute name="test" value="true"/> |
|||
</attributes> |
|||
</classpathentry> |
|||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> |
|||
<attributes> |
|||
<attribute name="maven.pomderived" value="true"/> |
|||
<attribute name="test" value="true"/> |
|||
<attribute name="optional" value="true"/> |
|||
</attributes> |
|||
</classpathentry> |
|||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"> |
|||
<attributes> |
|||
<attribute name="maven.pomderived" value="true"/> |
|||
</attributes> |
|||
</classpathentry> |
|||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> |
|||
<attributes> |
|||
<attribute name="maven.pomderived" value="true"/> |
|||
</attributes> |
|||
</classpathentry> |
|||
<classpathentry kind="output" path="target/classes"/> |
|||
</classpath> |
|||
@ -0,0 +1,23 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<projectDescription> |
|||
<name>PetRegistrations</name> |
|||
<comment></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.jdt.core.javanature</nature> |
|||
<nature>org.eclipse.m2e.core.maven2Nature</nature> |
|||
</natures> |
|||
</projectDescription> |
|||
@ -0,0 +1,8 @@ |
|||
eclipse.preferences.version=1 |
|||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 |
|||
org.eclipse.jdt.core.compiler.compliance=1.7 |
|||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled |
|||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning |
|||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore |
|||
org.eclipse.jdt.core.compiler.release=disabled |
|||
org.eclipse.jdt.core.compiler.source=1.7 |
|||
@ -0,0 +1,4 @@ |
|||
activeProfiles= |
|||
eclipse.preferences.version=1 |
|||
resolveWorkspaceProjects=true |
|||
version=1 |
|||
@ -0,0 +1,45 @@ |
|||
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
<groupId>petreg.org</groupId> |
|||
<artifactId>PetRegistrations</artifactId> |
|||
<version>0.0.1-SNAPSHOT</version> |
|||
<dependencies> |
|||
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --> |
|||
<dependency> |
|||
<groupId>org.seleniumhq.selenium</groupId> |
|||
<artifactId>selenium-java</artifactId> |
|||
<version>3.141.59</version> |
|||
</dependency> |
|||
|
|||
<!-- https://mvnrepository.com/artifact/commons-io/commons-io --> |
|||
<dependency> |
|||
<groupId>commons-io</groupId> |
|||
<artifactId>commons-io</artifactId> |
|||
<version>2.4</version> |
|||
</dependency> |
|||
<!-- https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager --> |
|||
<dependency> |
|||
<groupId>io.github.bonigarcia</groupId> |
|||
|
|||
<artifactId>webdrivermanager</artifactId> |
|||
<version>5.6.2</version> |
|||
</dependency> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
</dependencies> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
</project> |
|||
@ -0,0 +1,37 @@ |
|||
package userLogin; |
|||
|
|||
import org.openqa.selenium.By; |
|||
import org.openqa.selenium.WebDriver; |
|||
import org.openqa.selenium.WebElement; |
|||
import org.openqa.selenium.chrome.ChromeDriver; |
|||
|
|||
import io.github.bonigarcia.wdm.WebDriverManager; |
|||
|
|||
public class Buttons {public static void main(String[] args) throws InterruptedException { |
|||
WebDriverManager.chromedriver().setup(); |
|||
WebDriver driver= new ChromeDriver(); |
|||
driver.get("http://localhost:8061/login"); |
|||
driver.manage().window().maximize(); |
|||
Thread.sleep(3000); |
|||
WebElement Username = driver.findElement(By.id("login-username")); |
|||
Username.sendKeys("6380911830"); |
|||
Thread.sleep(3000); |
|||
WebElement password = driver.findElement(By.id("login-password")); |
|||
password.sendKeys("1234"); |
|||
Thread.sleep(3000); |
|||
WebElement submit = driver.findElement(By.xpath("//button[@class='btn btn-hero btn-primary']")); |
|||
submit.click(); |
|||
Thread.sleep(3000); |
|||
WebElement sidebarb1 = driver.findElement(By.xpath("(//span[@class='nav-main-link-name'])[2]")); |
|||
sidebarb1.click(); |
|||
Thread.sleep(3000); |
|||
WebElement sidebarb2 = driver.findElement(By.xpath("(//span[@class='nav-main-link-name'])[3]")); |
|||
sidebarb2.click(); |
|||
Thread.sleep(3000); |
|||
WebElement click1= driver.findElement(By.xpath("(//input[@class='form-control'])[1]")); |
|||
click1.click(); |
|||
Thread.sleep(3000); |
|||
click1.sendKeys("david"); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,125 @@ |
|||
package userLogin; |
|||
|
|||
import java.io.File; |
|||
|
|||
import org.openqa.selenium.By; |
|||
import org.openqa.selenium.JavascriptExecutor; |
|||
import org.openqa.selenium.WebDriver; |
|||
import org.openqa.selenium.WebElement; |
|||
import org.openqa.selenium.chrome.ChromeDriver; |
|||
import org.openqa.selenium.interactions.Actions; |
|||
import org.openqa.selenium.support.ui.Select; |
|||
|
|||
import io.github.bonigarcia.wdm.WebDriverManager; |
|||
|
|||
public class HomePage { |
|||
/** |
|||
* @param args |
|||
* @throws InterruptedException |
|||
*/ |
|||
public static void main(String[] args) throws InterruptedException { |
|||
WebDriverManager.chromedriver().setup(); |
|||
WebDriver driver= new ChromeDriver(); |
|||
driver.get("http://localhost:8061/login"); |
|||
driver.manage().window().maximize(); |
|||
|
|||
Thread.sleep(3000); |
|||
WebElement Username = driver.findElement(By.id("login-username")); |
|||
Username.sendKeys("6380911830"); |
|||
Thread.sleep(3000); |
|||
WebElement password = driver.findElement(By.id("login-password")); |
|||
password.sendKeys("1234"); |
|||
Thread.sleep(3000); |
|||
WebElement submit = driver.findElement(By.xpath("//button[@class='btn btn-hero btn-primary']")); |
|||
submit.click(); |
|||
Thread.sleep(3000); |
|||
//New Pet Regestration Button |
|||
WebElement NewpetRegestration = driver.findElement(By.xpath("(//button[@class='btn-block-option'])[1]")); |
|||
NewpetRegestration.click(); |
|||
Thread.sleep(3000); |
|||
//Pet name |
|||
WebElement petname = driver.findElement(By.name("petname")); |
|||
petname.sendKeys("Scooby"); |
|||
Thread.sleep(2000); |
|||
//species |
|||
WebElement ddown = driver.findElement(By.name("species")); |
|||
|
|||
Select selectspecies=new Select(ddown); |
|||
selectspecies.selectByIndex(1); |
|||
//pet colour |
|||
WebElement mark = driver.findElement(By.name("identificationmark")); |
|||
mark.sendKeys("brown"); |
|||
//Breed |
|||
WebElement breed = driver.findElement(By.name("breed")); |
|||
Select selectbreed=new Select(breed); |
|||
Thread.sleep(3000); |
|||
selectbreed.selectByIndex(3); |
|||
WebElement colour = driver.findElement(By.name("petcolor")); |
|||
colour.sendKeys("brown"); |
|||
WebElement gender = driver.findElement(By.name("gender")); |
|||
Select gen=new Select(gender); |
|||
gen.selectByValue("Female"); |
|||
WebElement age = driver.findElement(By.name("age")); |
|||
Select petage=new Select(age); |
|||
petage.selectByIndex(4); |
|||
WebElement petmonth = driver.findElement(By.name("Months")); |
|||
Select month=new Select(petmonth); |
|||
month.selectByIndex(3); |
|||
WebElement sterilized= driver.findElement(By.name("sterilized")); |
|||
Select steril=new Select(sterilized); |
|||
steril.selectByIndex(1); |
|||
WebElement adopted = driver.findElement(By.name("stray")); |
|||
Select adopt=new Select(adopted); |
|||
adopt.selectByIndex(2); |
|||
WebElement vaccine = driver.findElement(By.name("vaccinated")); |
|||
Select vaccin=new Select(vaccine); |
|||
vaccin.selectByIndex(2); |
|||
Thread.sleep(3000); |
|||
driver.switchTo().alert().accept(); |
|||
Thread.sleep(3000); |
|||
vaccin.selectByIndex(1); |
|||
WebElement date = driver.findElement(By.id("ARVDate")); |
|||
date.click(); |
|||
Thread.sleep(2000); |
|||
//previous Month |
|||
WebElement Nextmonth = driver.findElement(By.xpath("//span[@class='ui-icon ui-icon-circle-triangle-w']")); |
|||
Nextmonth.click(); |
|||
//ARV Administered DateDate(02-10-2023) |
|||
WebElement selectdate = driver.findElement(By.xpath("(//a[@class='ui-state-default'])[2]")); |
|||
selectdate.click(); |
|||
//Last Date Of De-Wormingn date(10-11-2023) |
|||
WebElement Date = driver.findElement(By.xpath("//input[@class='datepickers hasDatepicker']")); |
|||
Date.click(); |
|||
WebElement dat = driver.findElement(By.xpath("(//a[@class='ui-state-default'])[10]")); |
|||
dat.click(); |
|||
WebElement vacination = driver.findElement(By.id("OtherVaccination")); |
|||
vacination.sendKeys("No"); |
|||
WebElement oldlicensesno= driver.findElement(By.id("PreviousLicense")); |
|||
oldlicensesno.sendKeys("No"); |
|||
WebElement Veterinarydoctor = driver.findElement(By.id("Veterinarydoctor")); |
|||
Veterinarydoctor.sendKeys("Ashok"); |
|||
WebElement VeterinaryCouncilNumber = driver.findElement(By.id("TNVCNo")); |
|||
VeterinaryCouncilNumber.sendKeys("0111231455"); |
|||
Thread.sleep(3000); |
|||
|
|||
|
|||
//JavascriptExecutor jk=(JavascriptExecutor)driver; |
|||
//WebElement down = driver.findElement(By.id("button[@class='btn btn-sm btn-alt-secondary']")); |
|||
//Thread.sleep(3000); |
|||
//jk.executeScript("arguments[0].ScrollIntoView();",down); |
|||
// File uploadFile = new File("C:\\Users\\Testing\\Pictures\\Camera Roll\\new1"); |
|||
|
|||
// WebElement fileInput = driver.findElement(By.cssSelector("(//input[@class='form-control text-center'])[8]")); |
|||
// fileInput.sendKeys(uploadFile.getAbsolutePath()); |
|||
// driver.findElement(By.id("file-submit")).click(); |
|||
WebElement fileInput = driver.findElement(By.xpath("(//input[@class='form-control text-center'])[8]")); |
|||
fileInput.sendKeys("C:\\Users\\Testing\\Pictures\\Camera Roll\\new1"); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
//driver.close(); |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
Manifest-Version: 1.0 |
|||
Build-Jdk-Spec: 17 |
|||
Created-By: Maven Integration for Eclipse |
|||
|
|||
@ -0,0 +1,7 @@ |
|||
#Generated by Maven Integration for Eclipse |
|||
#Mon Dec 11 11:52:06 IST 2023 |
|||
m2e.projectLocation=C\:\\Users\\Testing\\eclipse-workspace\\PetRegistrations |
|||
m2e.projectName=PetRegistrations |
|||
groupId=petreg.org |
|||
artifactId=PetRegistrations |
|||
version=0.0.1-SNAPSHOT |
|||
@ -0,0 +1,45 @@ |
|||
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
<groupId>petreg.org</groupId> |
|||
<artifactId>PetRegistrations</artifactId> |
|||
<version>0.0.1-SNAPSHOT</version> |
|||
<dependencies> |
|||
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --> |
|||
<dependency> |
|||
<groupId>org.seleniumhq.selenium</groupId> |
|||
<artifactId>selenium-java</artifactId> |
|||
<version>3.141.59</version> |
|||
</dependency> |
|||
|
|||
<!-- https://mvnrepository.com/artifact/commons-io/commons-io --> |
|||
<dependency> |
|||
<groupId>commons-io</groupId> |
|||
<artifactId>commons-io</artifactId> |
|||
<version>2.4</version> |
|||
</dependency> |
|||
<!-- https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager --> |
|||
<dependency> |
|||
<groupId>io.github.bonigarcia</groupId> |
|||
|
|||
<artifactId>webdrivermanager</artifactId> |
|||
<version>5.6.2</version> |
|||
</dependency> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
</dependencies> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
</project> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue