What command in PowerShell can be used to determine the version of chromedriver.exe?

While working on a PowerShell script to upgrade my webdrivers before running a selenium script, I encountered an issue. The command I was using to retrieve the version of msedgedriver.exe was successful, but when I tried the same command for chromedriver.exe, it did not return any output nor did it display any errors.

The following command worked correctly:

(Get-Item C:\xyz\msedgedriver.exe).VersionInfo.FileVersion
  • Output: 104.0.1293.54

However, the command for chromedriver.exe did not produce any output:

(Get-Item C:\xyz\chromedriver.exe).VersionInfo.FileVersion
  • Output: Nothing returned

Interestingly, when I used a different command, it worked for chromedriver.exe:

C:\RAV\Web_Drivers\chromedriver.exe --version
  • Output:
    ChromeDriver 103.0.5060.53 (a1711811edd74ff1cf2150f40b17f-refs/branch-heads/5060@{#763})

Answer №1

According to input from Abraham Zinala, it appears that the field may not be defined for "chromedriver.exe". When using VersionInfo.FileVersion, you are actually querying a string field of the version resource, but what you should be looking for is the numeric version information. It's important to note that the string field may not always be up-to-date and could potentially contain an older version compared to the numeric fields.

In PowerShell 5.1 and newer, you can retrieve the numeric version info by querying the FileVersionRaw field:

$version = (Get-Item C:\xyz\msedgedriver.exe).VersionInfo.FileVersionRaw
$version.ToString()

For older PowerShell versions, you can extract the individual numeric fields that compose the version number:

$vi = (Get-Item C:\xyz\msedgedriver.exe).VersionInfo
$version = [Version]::new( $vi.FileMajorPart, $vi.FileMinorPart, $vi.FileBuildPart, $vi.FilePrivatePart )
$version.ToString()

If the above methods do not provide the desired information, you can explore other properties of VersionInfo by listing all properties with the Format-List command:

(Get-Item C:\xyz\msedgedriver.exe).VersionInfo | Format-List *

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Choosing an item from a dropdown menu in C# using Selenium in web assembly is proving to be ineffective

I am currently working on some automated tests using Selenium Web driver. I have been able to write a script that can locate the class, but I am facing difficulties in selecting one of the items from the drop down menu. Here is the script I have so far: ...

A guide on selecting a video with Selenium

I'm a newcomer to the world of coding with Python and its libraries, as well as being new to Stack Overflow. I apologize if I seem unfamiliar with some things. Now, onto my question. I am attempting to write a script that can automate playing a video ...

Tips for locating and interacting with a specific element using Selenium

I am delving into the realm of Python and honing my skills by creating practical applications for daily use. I recently embarked on automating a routine task, but hit a roadblock when attempting to utilize selenium to click on a specific element that dynam ...

Continuously click on button 1 in selenium with Java until button 2 is visible

In my current project, I am conducting tests on a native iOS mobile app by utilizing Selenium and Appium in conjunction with Java code. An essential part of the teardown process involves continuously clicking the "back" button until the "setting" button be ...

Error encountered: When attempting to use ChromeOptions for headless Google Chrome in Selenium Python, an AttributeError was raised indicating that the 'Options' object does not possess the attribute 'self'

For days, I've been attempting to set up headless chrome without any luck. It's frustrating not knowing what's causing the issue!! I've exhaustively searched through forums and tried every solution mentioned. Currently, I'm using ...

Using Selenium and Python to find an element with the "if not" statement before calling navigator.find_element

Good evening everyone, I am currently working on extracting data from a specific website: The program follows a loop-based logic. Upon opening the website page, the first step is to access the calendar and check for any matches played in the current mon ...

There are no interactive features shown in the screenshot

I'm capturing a screenshot using the following code: from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities dcap = dict(DesiredCapabilities.PHANTOMJS) dcap["phantomjs.page.settings.userAgent"] = ...

ChromeDriver continues to prompt the user with a 'Save password for this website' dialog, even after multiple attempts to disable the popup with command line switches

Every time I create a ChromeDriver using the code below, var options = new ChromeOptions(); options.AddArguments("chrome.switches", "--disable-extensions --disable-extensions-file-access-check --disable-extensions-http-throttling --disable-infobars --ena ...

The selenium webdriver encountered an error: java.lang.NoClassDefFoundError: Failed to initialize class sun.nio.ch.FileChannelImpl

Recently, I encountered an issue while working with Selenium. When attempting to run a basic test, the following error appeared: java.lang.NoClassDefFoundError: Could not initialize class sun.nio.ch.FileChannelImpl I scoured numerous posts on Stack Overf ...

Is there a way to confirm the functionality of the button for May 1st, 2019?

Currently using Eclipse(java) along with Selenium, encountering issues validating a button click event on the May 1st, 2019 date entry. The following methods have been attempted: driver.findElement(By.className("gws-travel-calendar__day-label")).click(); ...

Updating a data field in a table using selenium

When using selenium to input new values into the rows of a table on this website, I encountered a challenge. My current approach is as follows: URL = "https://sigmazone.com/catapult-grid/" browser = webdriver.Firefox("/usr/lib/firefox" ...

Error: Session ID is empty. Attempting to use WebDriver after quitting. Build information: version '3.0.1'

package com.epath.smoketest.tests; import static org.junit.Assert.assertTrue; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.util.Iterator; import java.util.Properties; import org.apache.commons.io.FileUtil ...

Is there a way to verify the presence of a link using Selenium IDE?

Looking for assistance with creating a test case in Selenium IDE as a new user. The test case should take the URL of the Home page as input and run tests repeatedly to check for the presence of all links on both the Home page and all inner pages. ...

Selenium for object capturing

While using Firefox and inspecting a link in my web application, I came across some code that I believe can be used to target an object: cb_or_somename_someothername cb_area_0219 This specific string is the "classname" in Firebug. When I attempted to fin ...

Troubleshooting Chrome driver version conflict with Selenium and PyInstaller in Python

Currently, I am utilizing the Google Chrome driver to automate various functions. To execute it, I have included this line in my code: driver = webdriver.Chrome(ChromeDriverManager().install()) Surprisingly, everything works smoothly when I run the progra ...

Suggestions for content in Jenkins Execute shell script for running automated tests

I'm a beginner with Jenkins and I'm unsure about what to enter in the Build - Execute shell script section. I want to run my automation scripts using Jenkins. I write my scripts in Selenium WebDriver and use macOS. Can someone provide me with a d ...

"Utilize Python's Selenium library to automate clicking the 'Get Data

Having trouble with clicking the GetData button to retrieve the output. Looking for assistance on how to achieve this. Update your code below:- from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.o ...

The issue with Protractor's sendkeys function is that it requires an X display for converting keycodes

I've encountered an issue while attempting to execute Protractor e2e tests in a Vagrant VM using headless Chrome. Despite successfully configuring Xvfb, I face an error when trying to fill out a form: unknown error: an X display is required for keycod ...

Error: WebDriverException - Error message: Unable to establish connection with Chrome browser, despite working perfectly just a minute

For the past 15 minutes, my Selenium scraper was functioning perfectly fine until it suddenly started throwing an error every time I run it. Here is the relevant code snippet: searchDate = wait.until(EC.element_to_be_clickable((By.XPATH, "/input[@placehol ...

Issue with the functionality of Selenium translate class in C#

I have developed a C# class that utilizes selenium to open a website and translate input text. This class is integrated into my project for translation purposes. Instead of using an API, I opted for the website's translation service as it allows me t ...