What are the benefits of using Marionette FirefoxDriver instead of the old Selenium FirefoxDriver for a Selenium tester?

The main advantage for using the Mozilla-provided, Marionette-based Geckodriver solution is that it works for versions of Firefox 48 and higher. The legacy driver provided and maintained by the Selenium project doesn’t work for Firefox 48 or higher, and will never work for those versions of Firefox. The legacy driver is implemented as a Firefox … Read more

Firefox webdriver opens first run page all the time

To turn off this annoying start page: in C# with Selenium 2.48 I found the following solution: FirefoxProfile prof = new FirefoxProfile(); prof.SetPreference(“browser.startup.homepage_override.mstone”, “ignore”); prof.SetPreference(“startup.homepage_welcome_url.additional”, “about:blank”); Driver = new FirefoxDriver(prof); …and it will never bother you again. Note: One of these settings alone will also work. I use them together to make it bullet-proof.

how can i remove notifications and alerts from browser? selenium python 2.7.7

You can disable the browser notifications, using chrome options. Sample code below: chrome_options = webdriver.ChromeOptions() prefs = {“profile.default_content_setting_values.notifications” : 2} chrome_options.add_experimental_option(“prefs”,prefs) driver = webdriver.Chrome(chrome_options=chrome_options)

Which Firefox version is compatible with Selenium 3.6.0

Selenium with Gecko Driver Selenium Release Perspective : Selenium v3.6.0 (Java) Release explicitly didn’t mention any dependency explicitly. The last dependency explicitly mentioned by Selenium was for v3.4.0 which is as follows : Geckodriver 0.16 is strongly recommended GeckoDriver Release Perspective : GeckoDriver v0.19.0: Firefox 55.0 (and greater) & Selenium 3.5 (and greater) GeckoDriver v0.18.0: … Read more

Selenium using too much RAM with Firefox

Well, This the serious problem I’ve been going through for some days. But I have found the solution. You can add some flags to optimize your memory usage. options = Options() options.add_argument(“start-maximized”) options.add_argument(“disable-infobars”) options.add_argument(“–disable-extensions”) options.add_argument(‘–no-sandbox’) options.add_argument(‘–disable-application-cache’) options.add_argument(‘–disable-gpu’) options.add_argument(“–disable-dev-shm-usage”) These are the flags I added. Before I added the flags RAM usage kept increasing after it … Read more

How to solve java.lang.NoClassDefFoundError? Selenium

The error says it all : java.lang.NoClassDefFoundError: com/google/common/base/Function at MainTest.openGoogle(MainTest.java:15) While working with Selenium v3.x you have to download geckodriver.exe from mozilla/geckodriver and place it in your system. Next you have to set the system property through the line System.setProperty() as follows and provide the absolute path of the GeckoDriver binary within your system as … Read more

How do I recover the “text” from the page originating the alert, esp **after** the human user has *clicked* [dismiss] on the page’s **alert**?

I have been struggling with this issue off and on for a long time; your comment on your question solved the problem for me: After both UnexpectedAlertPresentException and NoAlertPresentException are thrown… browser.execute_script(‘alert(“Clearing out past dialogs.”)’) browser.switch_to.alert.accept() As you said in your answer, webdriver is creating a ‘dialog’ when the alert is present. Closing the alert … Read more