In this post, we will see how to resolve How to get the browser and driver Version in Selenium C#
Question:
In C# we use theICapabilities cap =new ICapabilities;
to get the browser version or the driver version. When I run the code in a console application before the application run in the console information is printed there like the driver has started successfully and the driver version is also printed so as the browser version I would like to get that information that is printed on the console since if I wanted to check the browser version using a older driver the application won’t run which in turn means my code I have written to check the browser version won’t run to give me the results back. The question is there a way I can get the version of the driver from the output that is printed on the console before the application runs. I would like to do some automation where I can pair the browser version with the same driver version.Best Answer:
I don’t think you can do this before you start the application. And even though there should be an API to check the driver version and the browser version, it shouldn’t be a matter of Selenium.The only possible way to fulfill this purpose that I can come up with is to check their versions manually like this:
If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com