I had an issue with handling the server error page using selenium web driver.While navigating from one page to the other the webpage got crashed and the code which I wrote for fetching the Web Element which were in place is not responding.
//Function Call by passing the arguments
commFunction.ElementTitleValidation(driver,props,"CustomerPricing_SubMenu_Title");
//Method for ElementTitleValidation
public void ElementTitleValidation(WebDriver driver, Properties props,String MenuTitle)
{
boolean ElementTitle;
ElementTitle=ValidationHelper.isElementPresent(driver, By.xpath(LocatorModule(props,MenuTitle)));
System.out.println("The Visibility of Element title is "+MenuTitle+" and it is matching");
if(ElementTitle==false)
{
Assert.fail("ElementTitle Not Found !!!!");
System.out.println("ElementTitle Not Found !!!!");
}
//Method for Checking the WebElement Present or Not
public static boolean isElementPresent(WebDriver driver , By by){
WebElement ElementPresent=driver.findElement(by);
if( ElementPresent != null)
{
return true;
}
else{
return false;
}
}
So how to efficiently track such Page error or Server error issues while automating with selenium webdriver