How to handle browser notification popup which is without any elements?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


How to handle browser notification popup which is without any elements?



How to press the OK button as per the image.
I can switch to this window. but it is not loaded till i click ok, so there is no any elements.
Alert handle does't helped too.
Autoit cannot detect this pop up message too.
disable-notifications cant help too.
Any ideas?
Two screeshots is added.


OK



Firefox snapshot:



Look from FF



Chrome Snapshot:



Look from Chrome


p.companieGenreal.sActivities().click();
driver.switchTo().defaultContent();
String parent = driver.getWindowHandle();
p.companieGenreal.sAddNew().click();
p.companieGenreal.sAddJobOrder().click();
p.companieGenreal.sContract().click();
swithToChildWindow(parent);
driver.switchTo().alert().accept();





Your code trials?
– DebanjanB
1 hour ago





I can switch to this window. How did you do that ?
– cruisepandey
1 hour ago





Did you try writing driver.switchTo().alert().accept()
– Rajagopalan
1 hour ago


driver.switchTo().alert().accept()





This is java script alert and can be easily handled by selenium. I think the problem is with timing, you should implement WebDriverWait to wait until alert present as new WebDriverWait(driver, 60).until(ExpectedConditions.alertIsPresent()).accept()..Hope it helps.
– Saurabh Gaur
59 mins ago




WebDriverWait


new WebDriverWait(driver, 60).until(ExpectedConditions.alertIsPresent()).accept()




1 Answer
1



To treat it as an alert try this:


Alert a = driver.switchTo().alert();
a.confirm();



If it can be closed with Escape key, send Escape keypress like this (or ENTER if it closes when Enter is hit):


Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE);





Thanks! action.sendKeys(Keys.ESCAPE); is helped!
– Anton_Selenium
1 hour ago





@Anton_Selenium, please mark as answer if it works.
– Milan
1 hour ago





i was wrong it not helped ( sry
– Anton_Selenium
1 hour ago






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived