How to change the focus from chrome browser to internet explorer using selenium webdriver? - selenium

Scenario :
There is a button/link on a page opened in chrome browser and after clicking on a button/link it will navigate to the other link and opens in systems default browser i.e. Internet Explorer.
How to change the focus from chrome browser to internet explorer in selenium?

This is not possible.
You are starting your Chrome browser using the Chromedriver. You cannot handle Internet Explorer with your Chromedriver. You would need to use the IEDriver.
But as you did not start Internet Explorer using Selenium you would need to re-use an existing session. This is officially not supported see.
Nevertheless Tarun Lalwani was able to achieve this. See here and here.
I would suggest to save the link of the button/link before clicking on it and then start a new session using Internet Explorer and navigate to the saved link.

Related

Selenium ChromeDriver use already open browser

Help, please, dv question Selenium ChromeDriver.
Can I work in an already open Chrome browser? Or is it possible to open a new tab in an already open Chrome browser and work in it?
No, I do not believe this is possible.
They go to reasonable lengths to make Chrome display that it is being controlled by test software and presumably attaching to an existing browser window would create a vector for people to highjack the browser of unwitting users.

Using Chrome instead of Internet Explorer in Webbrowser

Is there any way to use Chrome instead of Internet Explorer
I've found a way to make webbrowser uses the latest Internet Explorer but still the website i want to visit doesn't support IE .... i even tried in Internet Explorer latest and it doesn't work like it does in Google Chrome !
You can get an open source API here: http://webkitdotnet.sourceforge.net/

Selenium Firefox - Browser is under remote control

I am using Firefox 55.0.2 (64-bit) with selenium. The code works fine, however I see an icon in Firefox saying Browser is under remote control and the URL is highlighted in orange as shown in below screen shot.
Is there a way to disable this message in Firefox?
You wouldn't get that in the previous versions of firefox (version 45 or below). Its just an update and cannot be disabled. Even google chrome shows a message(chrome is autmated by a software). or you could just use the previous versions of the browser.
Maybe not related directly to selenium use,
But in case of getting stuck in "under remote control" after having launched firefox with a kind of:
firefox -marionette -foreground -no-remote -profile /path/to/existing/profile
It's because this way it toggles marionette:true in about:config,
Thanks to Firefox Stuck in Remote Control Mode for pointing to this marionette config entry

How to disable developer tools in webpage opened by selenium driver?

I have created an application in selenium wherein it opens IE browser and enters user id and password by usind selenium's IE driver. However I want to prevent user from inspecting the auto data filled by selenium in the form. User can easily inspect the data using developer tools. So I want to know the way to disable developer tools options in selenium opened webpages.
Your help is highly appreciable.
Thanks.
Instantiate an instance of OpenQA.Selenium.Interactions.Actions then perform keystrokes for the F12 control. This should toggle on/off the developer tools in Chrome, IE, and Firefox.
I would also include a check to see if one of the controls from the devtools is there before toggling this, just to be sure that you don't turn them on instead of off.
c#:
OpenQA.Selenium.Interactions.Actions actions = new OpenQA.Selenium.Interactions.Actions([Instance of IWebDriver goes here]);
actions.SendKeys(OpenQA.Selenium.Keys.F12).Perform();

How do I enable popups in a new Firefox profile using selenium webdriver (Java)

The application I am testing requires pop-up to be enabled. When a launch a new Firefox profile I get the browser message
Firefox prevented this site from opening a pop-up window
with a button on the right called Options. I can manually click the Options button and select to Allow popups from ....
Question is how can I use profile.setPreference to set to allow popups from my website and also not show this Firefox message?
You can save your current Firefox prifile with allowed popups and load it from file like in this case: https://stackoverflow.com/a/6830109/1165331
save you current working profile with popups via browser and loat it.