I am trying to do the same test but with selenide instead of selenium. The web site i am testing requires these 4 arguments otherwise won't work.
Is there a way to define browser args using Selenide?
private val driver = ChromeDriver(ChromeOptions()
.addArguments("--disable-blink-features")
.addArguments("--disable-blink-features=AutomationControlled")
.addArguments("--disable-dev-shm-usage")
.addArguments("--no-sandbox")
)
Tried both ways but it seems the args are ignored.
command line:
./gradlew test -Dchromeoptions.args=--diagnostics,--disable-blink-features,-disable-gpu,--start-maximized,--disable-blink-features=AutomationControlled,--disable-dev-shm-usage,--no-sandbox
kotlin. Tested inside a @BeforeAll - JUnit5
val desiredCapabilities = DesiredCapabilities()
desiredCapabilities.setCapability(
ChromeOptions.CAPABILITY,
ChromeOptions()
.addArguments("--disable-gpu")
.addArguments("--start-maximized")
.addArguments("--disable-blink-features")
.addArguments("--disable-blink-features=AutomationControlled")
.addArguments("--disable-dev-shm-usage")
.addArguments("--no-sandbox")
)
desiredCapabilities.setAcceptInsecureCerts(true)
Configuration.browserCapabilities = desiredCapabilities
Thank you