Spring Boot selenium integration test with Headless Chrome runs very slow

122 views
Skip to first unread message

renanl...@gmail.com

unread,
Oct 30, 2017, 1:19:49 PM10/30/17
to ChromeDriver Users
I have a Spring Boot web application and some integration tests that run with selenium. All my integration tests inherit from:

BootIntegracaoTest.java
-----------------------

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, classes = EaudApplication.class)
@ActiveProfiles(value = "default,teste")
public abstract class BootIntegracaoTest {

@Autowired public Environment env;

static {
System.setProperty("webdriver.chrome.driver",
SystemUtils.IS_OS_WINDOWS ? "target/test-classes/chromedriver_win32.exe" : "target/test-classes/chromedriver_linux64");

ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
ChromeDriver driver = new ChromeDriver(options);
SeleniumQuery.$.driver().use(driver);
Runtime.getRuntime().addShutdownHook(new Thread(() -> $.driver().quit()));
}
}


If i take off the --headless argument, the tests runs on normal time. With headless argument, it runs really slow.

I've enabled chromedriver log and it seem's to be slow when waiting for some request: `[17.289][INFO]: Waiting for pending navigations...`


I'm using Selenium 2.53.1 and ChromeDriver: 2.32

I also have tried lots of chromium flags, but no success. If anybody has any similar issue that could help, thanks.

Reply all
Reply to author
Forward
0 new messages