I am pressing a cancel button than according to my code it is checking some text. In Chrome and Firefox it is working fine but in IE it is taking time to perform operation on alert box but code moves to next line.
So i want some code that stop till the operation is preformed on alert box and than it goes to next Step. I am doing automation testing using selenium.
Please find piece of code:
Alert al = driver.switchTo().alert();
al.accept();
wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(".//*[@id='content-body-full']/p[1]")));
assertEquals("Your cancellation request has been successfully executed.",driver.findElement(By.xpath(".//*[@id='content-body-full']/p[1]")).getText().toString());