Wednesday, February 3, 2016


Handle Web Message in selenium (C#)



public static void checkAlert(IWebDriver driver) {
try {
// WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementExists(element)); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
wait.Until(ExpectedConditions.TitleIs("Message from webpage"));
IAlert alert = driver.SwitchTo().Alert();
alert.Accept(); }
catch (Exception e) { //exception handling
}
}

No comments:

Post a Comment

Rest API Testing using Robot Framework and Python

 Environment Setup ----------------------------- Pre-requisites:     1) Python - Download python exe file from python official site  https:/...