0
votes

I am running Selenium automation test in one browser, but at the same time, I want to open the browser in another window and do something like checking mail, googling email then active mode or focus is coming to the current working window, not the automation test run browser.

Is it possible to work on the browser while automation test is run?

4

4 Answers

2
votes

In general, when doing UI automation, you cannot use the test machine to do any other tasks that involve using the keyboard or mouse.

Since WebDriver automation performs keyboard and mouse input, such as typing text and clicking items, you will be constantly interfering by taking focus away from the WebDriver instance of the browser and doing your own mouse and keyboard interaction in other applications.

This will adversely affect both you and the automation, with neither being able to do what they want to do!

You should either use a separate test machine, or setup a virtual machine using software such as VirtualBox (free).

1
votes

Did you try doing that?

Selenium uses WebDriver to communicate with a specific instance of a browser, not the currently focused window. So you should be able do continue to use other instances of browser windows. The best thing to do would be try.

If it isn't working, I would recommend getting a VM up and running and using that as your test environment. Generally that is the way I work to keep everything separate.

0
votes

I ran my tests on Firefox and then used chrome on the side. Otherwise, run your tests on a remote machine.

0
votes

You can do 2 things 1. Use a third tool to run test cases like Jenkins. so that test will run in memory. 2. If you are using firefox you can create a seperate firefox profile so that if you use firefox at the same time there should be any issue. To Create new FF profile use below code:

FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(false);
profile.setAssumeUntrustedCertificateIssuer(true);
DesiredCapabilities dc = DesiredCapabilities.firefox();
dc.setCapability(FirefoxDriver.PROFILE, profile);
WebDriver driver = new FirefoxDriver(dc);