Open ecchioni opened 4 years ago
Have u checked the API document, is it even supported
If it is not supported than the product is next to useless.
If you're using C#, you can easily write a WebDriverWait function that executes an anonymous function to do this. Something like:
WebDriverWait wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(15));
wait.IgnoreExceptionType(typeof(WebDriverException));
var alert = wait.Until(x => Driver.SwitchTo().Alert());
Might take a bit of tweaking to get to work right, but that should get you started at least. I believe java has the same functionality, but I'm not as familiar with the syntax to know how to demonstrate a good example.
@ecchioni, @PandaMagnus Looks like is not supported for now:
OpenQA.Selenium.WebDriverException: Command not recognized: GET: /session/CA65D585-13E8-4D31-9106-563D457FD945/alert_text
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Appium.AppiumDriver`1.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteTargetLocator.Alert()
ExpectedConditions.AlertIsPresent() is throwing System.InvalidOperationException: Command not recognized: GET: /session/CB68F3EE-CF0A-4DA3-9926-F88DBB3BFA35/alert_text at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary
2 parameters) at OpenQA.Selenium.Appium.AppiumDriver
1.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Remote.RemoteTargetLocator.Alert() at OpenQA.Selenium.Support.UI.ExpectedConditions.<AlertIsPresent>b__4c(IWebDriver driver) at OpenQA.Selenium.Support.UI.DefaultWait
1.Until[TResult](Func`2 condition)