Geb test ignoring GebConfig.groovy file launched in IntelliJ helped me get the ChromeDriver to be used, but now I have the problem that ChromeOptions are not being used despite being supplied.
I took the solution provided and just added the assignments found in other StackOverflow solutions:
import org.openqa.selenium.chrome.ChromeDriver
import org.openqa.selenium.chrome.ChromeOptions
System.setProperty("webdriver.chrome.driver", "my/path")
// This was one option suggested, but I'm trying the assignment inside the environment block.
// I tried this way, too.
// driver = {new ChromeDriver()}
environments {
chrome {
driver = {
ChromeOptions opts = new ChromeOptions()
opts.addArguments("--user-data-dir=/home/guy/.config/automation-google-chrome/")
opts.addArguments("--start-maximized")
new ChromeDriver(opts)
}
}
}
Now the browser comes up fine, but the opts
are not used: not maximized, and the browser look-and-feel is obviously not right. I had the same problem when I was using straight Selenium, and I solved it by using the user-data-dir above. Using same ChromeDriver, too.
The program output says:
Starting ChromeDriver 2.20.353124 (very long number here) on port 25082
Tried (deprecated) DesiredCapabilities
, but same.
TIA