this line passed it meas an Aleart is there. WebElement elementOpen = wd.findElement(By.xpath("/html/body/button")) īoolean present1 = WebUI.verifyAlertPresent(5, FailureHandling.STOP_ON_FAILURE) WebDriver wd = DriverFactory.getWebDriver() WebUI.navigateToUrl(" // I have a HTTP Server at which makes the katalon project accessible as a web site. I tried to reproduce your issue on my side usig the alert.html you shared. WebElement elementOpen = wd.findElement(By.xpath(“/html/body/button”)) WebDriver wd =DriverFactory.getWebDriver() WebUI.navigateToUrl(‘f:\Testing\alert.html’) Import .checkpoint.Checkpoint as Checkpoint Import .testobject.TestObject as TestObject Import .model.FailureHandling as FailureHandling Import internal.GlobalVariable as GlobalVariable Of course you need to change the path to where ever you saved the alert.html The following test script will open the alert.html and display the alert, and attempt to accept it. If you execute the test script, you will see it flash on and then off. If you execute the file directly from the browser, you will see that the alert does not flash on and then off, it waits for input. I’ve create alert.html to simulate the alert opening in the browser. The alert appears and disappears before it can be accepted and causes my test to fail. I run through the test manually and the alert appears and waits for me to accept it, this is working as expected. I expect the WebUI.acceptAlert() to be able to accept the alert when it appears. 45 (Official Build) (64-bit) Steps to reproduce:Ĭreate a test case that ensures an alert will appear and acceptAlert In this video you can see something appear in the top left of the screen and then disappear. Version 8.2.0 build 208 Katalon Studio logs How would your work be affected if this issue has not been resolved?Īlerts on other pages are appearing and disappearing as well, before it can be accept it, which is causing my test to fail Operating System This is causing the acceptAlert() to fail because the alert is no longer there to be accepted. However it seems to appear and disappear straight away, before I can accept it. I would accept the alert and continue on with the rest of the test. My automation is clicking the link and as a result of the click, an alert would normally appear and wait to be accepted. I’m testing the Clear Cache link on my page. If(event.getAction() = MotionEvent.Please let us know what you are using Katalon Studio for? View plainprint? public boolean onTouchEvent(MotionEvent event) So in this case, you can dimiss your dialog or decide what you wanted to perform. ' MotionEvent.ACTION_OUTSIDE' means, user is interacting outside the dialog region. _NOT_TOUCH_MODAL) Ģ - Add another flag to windows properties, FLAG_WATCH_OUTSIDE_TOUCH - this one is for dialog to receive touch event outside its visible region.ģ - Override onTouchEvent() of dialog and check for action type. Something like, Dialog dialog = new Dialog(context)ġ - Set the flag- FLAG_NOT_TOUCH_MODAL for your dialog's window attribute Window window = this.getWindow() You can use tCanceledOnTouchOutside(true) which will close the dialog if you touch outside of the dialog.
0 Comments
Leave a Reply. |