Solution if element id not found

29 views
Skip to first unread message

ankur

unread,
Mar 31, 2015, 7:26:55 AM3/31/15
to seleniu...@googlegroups.com
Hi,

I am using below code
 
  //Verify UserID text-box on Login page
    public static WebElement verify_uxtsernametebox(WebDriver driver)
    {
        element = driver.findElement(By.name("uid"));
        return element;
    }

& using this method verify_uxtsernametebox()  in below code in other class.

abc = loginPage.verify_usernametextbox(driver).isDisplayed();  

Now my question- what will happen if "uid" (which is the locator of username text box) will not found on page or not displayed on page?
How to handle this scenario? How to give proper error message?


Reply all
Reply to author
Forward
0 new messages