commit 79d872a7c6976528fad867cf3010423d4ebfc678 Author: unknown Date: Tue Dec 12 11:22:38 2023 +0530 first commit diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..2e2268a --- /dev/null +++ b/.classpath @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..a6cfe93 --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ + + + PetRegistrations + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..a3b98fd --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -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 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..61b4538 --- /dev/null +++ b/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + petreg.org + PetRegistrations + 0.0.1-SNAPSHOT + + + + org.seleniumhq.selenium + selenium-java + 3.141.59 + + + + + commons-io + commons-io + 2.4 + + + + io.github.bonigarcia + + webdrivermanager + 5.6.2 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/java/userLogin/Buttons.java b/src/test/java/userLogin/Buttons.java new file mode 100644 index 0000000..2444e52 --- /dev/null +++ b/src/test/java/userLogin/Buttons.java @@ -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"); +} + +} diff --git a/src/test/java/userLogin/HomePage.java b/src/test/java/userLogin/HomePage.java new file mode 100644 index 0000000..770ab42 --- /dev/null +++ b/src/test/java/userLogin/HomePage.java @@ -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(); + +} +} diff --git a/target/classes/META-INF/MANIFEST.MF b/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000..b55046a --- /dev/null +++ b/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Build-Jdk-Spec: 17 +Created-By: Maven Integration for Eclipse + diff --git a/target/classes/META-INF/maven/petreg.org/PetRegistrations/pom.properties b/target/classes/META-INF/maven/petreg.org/PetRegistrations/pom.properties new file mode 100644 index 0000000..c498b0d --- /dev/null +++ b/target/classes/META-INF/maven/petreg.org/PetRegistrations/pom.properties @@ -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 diff --git a/target/classes/META-INF/maven/petreg.org/PetRegistrations/pom.xml b/target/classes/META-INF/maven/petreg.org/PetRegistrations/pom.xml new file mode 100644 index 0000000..61b4538 --- /dev/null +++ b/target/classes/META-INF/maven/petreg.org/PetRegistrations/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + petreg.org + PetRegistrations + 0.0.1-SNAPSHOT + + + + org.seleniumhq.selenium + selenium-java + 3.141.59 + + + + + commons-io + commons-io + 2.4 + + + + io.github.bonigarcia + + webdrivermanager + 5.6.2 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/test-classes/userLogin/Buttons.class b/target/test-classes/userLogin/Buttons.class new file mode 100644 index 0000000..9c5761d Binary files /dev/null and b/target/test-classes/userLogin/Buttons.class differ diff --git a/target/test-classes/userLogin/HomePage.class b/target/test-classes/userLogin/HomePage.class new file mode 100644 index 0000000..a3dcce7 Binary files /dev/null and b/target/test-classes/userLogin/HomePage.class differ