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 Answer of Questions and ASK to Doubt