plaidshirt
plaidshirt

Reputation: 5671

Execute WebDriver based tests without browser focus

There is a test written in Java, which I execute from IntelliJ IDEA and opens a Firefox. It uses some files from local machine to upload those and then receive too some files. In this case browser window needs permanent focus, otherwise it is not working, can't select the necessary files. I would like to use machine during test is running, because test is long-running. How could I execute it without browser focus?

Upvotes: 1

Views: 537

Answers (2)

iamsankalp89
iamsankalp89

Reputation: 4739

You have to use HtmlUnitDriver or PhantomJS to Execute WebDriver based tests without browser focus.

WebDriver driver = new HtmlUnitDriver();

driver.get("http://www.google.com");

Upvotes: 1

implssv
implssv

Reputation: 72

I think I understand what you are trying to achieve.

Try to use non GUI browsers like PhantomJS or HtmlUnit

http://htmlunit.sourceforge.net/ and How to implement PhantomJS with Selenium WebDriver using java

Upvotes: 1

Related Questions