How to get rid of google pop-ups while testing and navigation google url? - selenium

Every time I navigate to google through Selenium, I encounter this popup. I can't click on the search bar. Is there a way to close permanently this popup without using any JS alert method etc.?
I tried some extensions but it didn't work

Click the Lock button (🔒) on the top-left of the search box
Click on 'Cookies'
Make sure you're on 'allowed' and find anything on the lines of google.com
Click Block, Done and refresh the page
Additionally, you may want to try it first without the web-driver 'Chrome is being controlled by automated test software' mode, so open Google Chrome you way you usually would.

Related

How to handle Micro Popup in Webdriver.io browser

When starting a website, I find it difficult to click Block button on Microphone popup because I can't query this popup (and also with block btn)
How can I handle this problem with Webdriver.io in browser?
enter image description here
One option is to use chrome command line switches. You can find the list here.
The one you are looking for is use-fake-device-for-media-stream. You can set this in your config file so that every time the chrome is launched, it won't show this popup since it is already set to a fake device.

NewRelic scripted browser interact with popup for login

Is it anyhow possible in new relic scripted browser to interact with a popup?
Is the following possible and if yes, how can I achieve the following?
Open url "https://sample.com"
Click button with id login
A popup opens
In popup fill username and password and click submit
Popup closes
Continue within application.
Basically the popup is the piece I'm struggling with. I searched documentation but was not able to find anything on how to interact with the popup.
Thx I really appreciate your expertise
This depends on what popup is defined as - a new browser window or an element embedded in a div or iframe? Either way, here are some solutions to either one:
Switching to a new browser window: https://github.com/newrelic/quickstarts-synthetics-library/blob/main/library/TabOrWindowSwitching/script.js
New Relic forum post containing several solutions/examples: https://discuss.newrelic.com/t/how-to-handle-intermittent-pop-up/38200

How can I fix a button that is clicked but does not perform any actions?

So I'm currently working on a new project and I need to write some automated tests.
I came across a problem and I don't know how to fix it. If the button of my web page is clicked running selenium it doesn't perform any actions, but if I open the web page manualy and click on the button, everything works fine.
NOTE: I'm completely sure that the xpath is correct and the button is being clicked...
This is what happens running with selenium:
And this is what happens openning the web page manually and clicking on the button:

Selenium test closing window dialog

I'm using Selenium with Robot Framework to write my GUI tests. One of the tests is verifying if, when the user clicks on the Close window/tab button (outside of the webpage), it triggers the alert box before exiting.
I've tried the keywords "Close window" and "Close browser", but both of them ignore the event and close the window. I also tried to close the window with javacript window.close();, but it doesn't work for windows that aren't opened with window.open(); - it is a security measure. I'm using Selenium Grid with different browsers on Linux and Windows, but everytime is failing. Is there a possibility to check this with selenium or I have to use other tools like AutoIT that automate any GUI, not only the browser?
After five days of searching for a solution, I didn't find one that tries to close the page/tab/window and triggers that alert confirmation box.
Instead, I found a workaround that is similar to that and also triggers the necessary alert which is captured by Selenium: click on a link, reopen the same page or go to another one. Like this:
Go To https://stackoverflow.com/
Handle Alert action=DISMISS
I put here action=DISMISS to simply continue with my test on the same page, but if there is need you can change it to something else.

How to identify Adobe flash player pop-up window using selenium for validation?

Is there a way selenium can identify and validate a Adobe flash player pop-up window?
say, you visit this site (http://sports.coral.co.uk/#) and click on "Coral Radio" submenu under Sports Menu. It opens a Adobe pop-up window. I can validate the presence of a pop-up window opening and close it, but I want to know if there is a way to assert on some content of that window? at least the title of the page before I close it?
Thanks for responding if anyone knows how to deal with this scenario.
To switch to a popup window, you need to use driver.getWindowHandles() and iterate through them. Then you can use driver.getTitle();
I've never found a way to get any content from Flash. I've heard something about automatic screenshots in headless mode, but then you have to check it manually probably again.