Java, .NET, PHP, PYTHON, ANGULAR, ML, Data Science, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

 Webdriver script to check that title of the application is Valid or not?


The title length is 64, if the title is above this the title is invalid.    


package scs;


import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;


public class WebDriverExamle2 {


public static void main(String[] args) {

System.setProperty("webdriver.chrome.driver", "c://chromedriver.exe");

WebDriver scs= new ChromeDriver();

scs.get("https://eroomrent.in");

    String s = scs.getTitle();

    if(s.length()<=64)

    {

    System.out.println("Title is Valid");

    }

    else

    {

    System.out.println("Title is Invalid");

    }

}


}



WebvDriver Script to check Login of EroomRent Site?

package scs;


import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.chrome.ChromeDriver;


public class LoginScriptExample {


public static void main(String[] args) {

System.setProperty("webdriver.chrome.driver", "c://chromedriver.exe");

WebDriver scs= new ChromeDriver();

scs.get("https://eroomrent.in/ownerlogin.php");

WebElement ele = scs.findElement(By.name("txtEmail"));

ele.sendKeys("shiva.gtm@gmail.com");

WebElement ele1 = scs.findElement(By.name("txtPassword"));

ele1.sendKeys("12345");

scs.findElement(By.name("btnsubmit")).click();


}


}





Post a Comment

POST Answer of Questions and ASK to Doubt

Previous Post Next Post