Skip to main content

Posts

Showing posts from July, 2017

Run different version of firefox using python selenium

Hello, If you are looking for Google Chrome , please see this link. For some purpose I had to run different versions of Mozilla Firefox using selenium python. I used different versions of firefoxes from  here . After downloading proper version/os version, I had to simply install the browser using custom mode. Then choose a custom place to install. Like C:\Program Files\FirefoxVersion54 Important: Do not launch the firefox. Go to the installation directory and delete three update files from there namely: 1. updater.exe 2. updater.ini 3. update-settings.ini Then launch the firefox and check the version. Now from the python code do the following: from selenium.webdriver.firefox.firefox_binary import FirefoxBinary from selenium import webdriver import random # Assumed that you have installed 52 and 53 as well in the proper path. version_to_use = random.choice(['54', '52', '53'])  path = r'C:\\Program Files\\FirefoxVersion%s\\fire

Run different version of chrome using python selenium

Hello, If you are looking for Firefox , please see this link For some purpose I had to run different versions of google chrome using selenium python. I used different versions of chromes from here . A discussion on stackoverflow can be found here I extracted the compressed file and moved the chrome.exe file inside the directory with version name. Please see the screenshot below. Notice the chrome executable in this directory. I downloaded few more versions and did same with them. Then I places those inside the following directory: C:\Program Files (x86)\Google\Chrome Then I had to use binary_location as below. I had four different versions as shown in the image above. Out of them, one was randomly picked using random.choice()  method and the binary_location was created on runtime. from selenium import webdriver import random chrome_options = webdriver.ChromeOptions() available_versions = ['56.0.2924.87', '57.0.2987.133'