Can I set driver's version when use zalenium - automation

I tried to use Zalenium to run my automation cases. The default driver version is latest like chromedriver is v84 but I wanna to use version 76. Is there any way to change it?
My automation is running with TestNG + selenium.

You would need to use one of the docker images that has the versions you need, you can check the releases at elgalu/docker-selenium here https://github.com/elgalu/docker-selenium/releases

Related

Why is chromedriver tied to chrome version?

I'm starting to use selenium and ChromeDriver in order to automate tasks in Chrome. I'm interested in scaling the task across multiple managed windows PC's.
I understand that updates of Chrome might break functionality in ChromeDriver. But I'm concerned it's the right tool because manually updating based on the chrome version results in a lot of maintenance as we'd have to manually place the executable on each system.
Is ChromeDriver really "whitelisting" with which chrome version it works? and why is that?
Browsers would have updates, which the driver also must have in order to invoke and interact with the browser, and hence your driver version must be in sync with the browser version. It is not just for Chrome, but for Firefox, and Edge also. One thing you can do is to use the ChromeDriverManager by installing the webdriver-manager library.
In Python, you do like this:
pip install webdriver-manager
In the py file, you can invoke the chromedriver:
from webdriver_manager import ChromeDriverManager
Then, when you initialize the driver, you can pass in the ChromeDriverManager:
driver = webdriver.Chrome(ChromeDriverManager().install())
With this, your driver and browser would be in sync. You need not worry about the incompatibility of driver-browser versions.
Please note: you would get a depcration warning with the above driver line of code, for which you need to include Service object; however, for now, it is a warning and not an error, so your code would not hamper the execution, but sooner or later, you must use Service object.
Here is a good article you can refer to Medium

How to update Chromedriver version in PyCharm for selenium-robotframework

I am using PyCharm to run my robot framework-selenium scripts.
I am facing an issue
SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 91 Current browser version is 93.0.4577.63 with binary path
Attached are my settings.
How to upgrade chromedriver for Chrome version 93 or any other suggestion. I have 75 automation scripts and it is not feasible to add driver = chrome path in all the scripts.
Browser drivers
The general approach to install a browser driver is downloading a right driver, such as chromedriver for Chrome, and placing it into a directory that is in PATH
Drivers for different browsers can be found via Selenium documentation or by using your favorite search engine with a search term like selenium chrome browser driver. New browser driver versions are released to support features in new browsers, fix bug, or otherwise, and you need to keep an eye on them to know when to update drivers you use.
Alternatively, you can use a tool called WebdriverManagerwhich can find the latest version or when required, any version of appropriate webdrivers for you and then download and link/copy it into right location. Tool can run on all major operating systems and supports downloading of Chrome, Firefox, Opera & Edge webdrivers.
Here's an example:
pip install webdrivermanager
webdrivermanager firefox chrome --linkpath /usr/local/bin
Please go through, here, everything is documented here.

How to set the firefox binary in Serenity (previous to geckodriver)?

I'm using the serenity 1.1.42 version and I would like to run my test cases in different versions of Firefox. To do that, I try to set where is the Firefox binary file, because I'm using Mac OS, but serenity always starts with the default installed version on mi computer, the last.
What I have tried? I put into the serenity.properties file this different combinations:
webdriver.firefox.driver=/Users/myuser/Applications/Firefox55.app/Contents/MacOS/firefox-bin
In other execution:
webdriver.firefox.preferences="firefox.binary=/Users/myuser/Applications/Firefox55.app/Contents/MacOS/firefox-bin"
In other execution:
webdriver.driver=/Users/myuser/Applications/Firefox55.app/Contents/MacOS/firefox-bin
In one more execution:
webdriver.firefox.bin=/Users/myuser/Applications/Firefox55.app/Contents/MacOS/firefox-bin
But no one of this configurations worked for me. How should I configure the serenity.properties file to run my own version of Firefox?
Thank you in advance.
I solve how to pass the Firefox binary. I should pass as argument in the execution:
-Dwebdriver.firefox.bin=/Users/myUser/Applications/Firefox44.app/Contents/MacOS/firefox-bin
But, two things to have in mind:
It is important not used with geckodriver, because selenium 3.0, or higher, cannot work with old Firefox versions.
I cannot set this property from the serenity.properties. It is ignored.

Can i launch firefox with selenium 3.3.0 version without geckodriver

I need launch Firefox browser with selenium 3.3.0 version.
Is any way to launch without geckodriver ?
For Selenium 2.x later versions it is mandatory to use gecko-driver for Firefox browser. If you don't want to use gecko-driver use selenium 2.x(2.53) version

How to update chromedriver version to 35?

I am using chromedriver version 2.10. I have update the version to 35.
Could anyone provide how can i achieve that?
Read on if your webdriver-manager update doesn't update chromedriver
to the latest.
I lost a few weeks pulling my hair around an issue I had with "Unable to discover open pages" and every time I would update the chromedriver, it would update to version 2.22 for chromedriver and I believe the selenium server to v2.53.
My problem wasn't really with the selenium server so v2.53 was fine.
Issue was with chromedriver v2.22.
Eventhough this chromdriver link showed that there was a latest version of 2.24, 'webdriver-manager update' would NOT pick up that latest version, it would only grab version 2.22 of the chrome driver.
How did I go around this?
Simply run the command below after you check this link for which version of chromedriver you want to update to; for instance, I wanted v2.24 so I ran the command below:
webdriver-manager update --versions.chrome 2.24
If you check your location: C:\Users\<USER>\AppData\Roaming\npm\node_modules\webdriver-manager\selenium\
You should see that the desired chromedriver was downloaded there; if it's not there, read the command prompt logs and it'll tell you where it downloaded your chromdriver files.
Hope that helps someone!
Chromedriver latest version is 2.10. You can check versions http://chromedriver.storage.googleapis.com/index.html.
We can update chrome version to 35 http://filehippo.com/download_google_chrome/57050/
You should distinguish between chromedriver and chrome as a browser.
The version of chromedriver is not connected with version of chrome browser but you'd better use the latest version of chromedriver.
ChromeDriver and Chrome browser are two separate applications.
ChromeDriver is an implementation of WebDriver, an API which allow us to control browser behaviour.
In ChromeDriver case it's used to control Chrome browser of some version.
As you noted, ChromeDriver last version is 2.10
The version of the Chrome browser which is controlled by the ChromeDriver, got separate development flow and get updated independently to ChromeDriver, Chrome browser version in your case is 35.
In conclusion, don't mix the two applications, they different.
P.S. it's important to note, that in some occasion when new browser version released, the according driver got updated to in order to update it's behaviour according to the new developments of the browser.