Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package selenium2Pack;
- static FirefoxDriver driver = new FirefoxDriver();
- loginPOI xpath;
- @Test
- public void AddEducation() throws InterruptedException{
- loginPOI.CounselorLogin();
- Thread.sleep(10000);
- //Click on Education tab
- driver.findElement(By.xpath("html/body/div/div[2]/div/div/div/div[2]/div/div[1]/nav/ul/li[2]/a")).click();
- Thread.sleep(5000);
- //Click on AddNew button
- driver.findElement(By.xpath("html/body/div/div[2]/div/div/div/div[2]/div/div[3]/div/div[1]/a/i")).click();
- }
- package selenium2Pack;
- static FirefoxDriver driver = new FirefoxDriver();
- static String firstName = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[1]/div[1]/input";
- String Email,LastName,BrowseButton,Username,Password,ContactNo,Gender,DOB,Country,State,City,Street,Address,Marital_status,Logout,EducationTab;
- static String RegisterURl = "http://192.163.222.186/~puzzlelife/development/#/register";
- static String LoginURL = "http://192.163.222.186/~puzzlelife/development/#/login";
- public void main() throws InterruptedException{
- String firstName = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[1]/div[1]/input";
- String LastName = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[1]/div[2]/input";
- String BrowseButton = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[2]/div[1]/input[1]";
- String Email = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[2]/div[2]/input";
- String Username = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[3]/div[1]/input";
- String Password = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[3]/div[2]/input";
- String ContactNo = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[3]/div[2]/input";
- String Gender = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[4]/div[2]/select";
- String DOB = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[5]/div[1]/div/span/span";
- String Country = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[5]/div[1]/div/span/span";
- String State = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[6]/div[1]/select";
- String City = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[6]/div[2]/select";
- String Street = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[7]/div[1]/input";
- String Address = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[7]/div[2]/textarea";
- String Marital_status = "html/body/div/div[2]/div/div/div/div[2]/div/div/form/div[1]/div[8]/div/select";
- String Logout = "html/body/div/header/div/div[3]/div/a[2]";
- String EducationTab = "html/body/div/div[2]/div/div/div/div[2]/div/div[1]/nav/ul/li[2]/a";
- }
- public static void CounselorLogin() throws InterruptedException{
- driver.get(LoginURL);
- Thread.sleep(15000);
- driver.findElement(By.id("username")).sendKeys("arun");
- driver.findElement(By.id("password")).sendKeys("arun");
- Thread.sleep(5000);
- WebElement submit =driver.findElement(By.xpath("html/body/div/div[2]/div/div[2]/div/div/div[2]/div/form/button"));
- submit.click();
- Thread.sleep(5000);
- String CurrentURL = driver.getCurrentUrl();
- if(LoginURL.equals(CurrentURL))
- System.out.println( "Un-Successful to login");
- else
- System.out.println("Successful to login");
- Thread.sleep(10000);
- }
- public static void Logout() throws InterruptedException{
- //Click on Logout Button
- driver.findElement(By.xpath("html/body/div/header/div/div[3]/div/a[2]")).click();
- Thread.sleep(5000);
- //Check text on page
- if(driver.getPageSource().contains("Login"))
- System.out.println("Successfully Logout");
- else
- System.out.println("Un-Successfully Logout");
- }
- public static void DOB(){
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement