serenity-bdd / serenity-core

Serenity BDD is a test automation library designed to make writing automated acceptance tests easier, and more fun.
http://serenity-bdd.info
Other
721 stars 517 forks source link

Serenity Browser Auto Download in Docker Container #3297

Open pdevaraj14 opened 1 year ago

pdevaraj14 commented 1 year ago

Discussed in https://github.com/serenity-bdd/serenity-core/discussions/3293

Originally posted by **pdevaraj14** October 19, 2023 Hi, can anyone please tell me if its possible for the selenium webdrivermanager to auto download the browser itself in a linux environment. I'm able to get it locally working on windows but it seems like only the drivers are downloading in the linux image in docker container. The serenity conf file im using is the following: `serenity { take.screenshots = FOR_EACH_ACTION } environment = firefox environments { chrome { webdriver { autodownload = true capabilities { proxy { proxyType = "autodetect" } browserName = "chrome" browserVersion = "stable" acceptInsecureCerts = true "goog:chromeOptions" { args = ["test-type", "ignore-certificate-errors", "start-maximized", "headless=new" "incognito", "disable-infobars", "disable-gpu", "disable-default-apps", "disable-popup-blocking", "disable-dev-shm-usage", "no-sandbox"] } } } } edge { webdriver { capabilities { browserName = "edge" "ms:edgeOptions" { args = ["test-type", "ignore-certificate-errors", "headless", "incognito", "disable-infobars", "disable-gpu", "disable-default-apps", "disable-popup-blocking"] } } } } firefox { webdriver { autodownload = true capabilities { proxy { proxyType = "autodetect" } browserName = "firefox" browserVersion = "118" pageLoadStrategy = "normal" acceptInsecureCerts = true unhandledPromptBehavior = "dismiss" "moz:firefoxOptions" { args = ["--headless"], prefs { "javascript.options.showInConsole": false }, log {"level": "info"}, } } } } }`
wakaleo commented 1 year ago

Selenium doesn't do this - it is your responsibility to ensure that the correct browsers are installed.

pdevaraj14 commented 1 year ago

Thank you for the response wakaleo. I was following the documentation at page: https://www.selenium.dev/blog/2023/whats-new-in-selenium-manager-with-selenium-4.11.0/ which states that there is automated browser management. I was able to get the automated browser management working locally but its not behaving the same in a docker environment and was just wondering if there is a specific proxy setting i have to use in the Serenity.conf file to enable it. Thanks again.

wakaleo commented 1 year ago

Nothing that I am aware of (there might be a W3C option but I haven't seen it mentioned anywhere). If it works locally I suspect it would be a question of configuring your Docker image rather than Serenity or Selenium