Is SeleniumBasic v2.0.9.0 still the latest version and is it compatible with Chrome/ChromeDriver Version 103.0.5060.53 (Official Build) (64-bit)? - vba

I'm using VBA in Microsoft Access 365 and want to use it for web automation (filling web forms and getting the resulting information using variables)
I'm not 100% sure, but it looks like SeleniumBasic is installing an outdated ChromeDriver.exe? (2.21.371459)
Error Screenshot
My current version of Chrome is: Version 103.0.5060.53 (Official Build) (64-bit)
I'm reading all sorts of information about IDE's etc, and it's all a bit overwhelming! :(
To test this theory, I went ahead and replaced the ChromeDriver.exe file in C:\Program Files (x86)\SeleniumWrapper with the newer, compatible version # 102.0.5005.61
The code now throws another error
but at least it's now showing the correct driver. The error information screenshot also says that "DevToolsActivePort file does not exist". What??? How do I set that up? As I said, overwhelming.

Try using the .Start before using the .Get. Yes, this vba version of selenium hasn't had regular (or any) updates in like 8 years so it's not perfect. You have to keep your drivers up to date etc. You'll have a much better experience if you use Selenium with Python or Java.
Dim sel As New Selenium.ChromeDriver
Dim url As String
sel.Start "chrome", "http://google.com"
sel.Get "/"

Related

What do you do when the chromedriver that matches your chrome version isn't out yet?

I have a specific use case requiring me to use 'Selenium Basic' for VBA.
The versions don't match and it fails as seen in the image below:
The problem is that the chromedriver that matches the chrome installed isn't out yet.
Moreover, all other browsers except the useless I.E. have the same error, and I mean, Firefox or Opera would do of course.
Here is the error these browsers have below.
I initially believed maybe Kaspersky was at fault however its not: even off this connectivity problem persists.
I've google for exactly 65 minutes before writing this.
If you have anything of value to share, it would really help me out professionally here.
Thank you kindly,
Chromedriver version:
If you look at the official download site you will see the appropriate version is the Chrome version 89. This covers your version. FireFox is no longer supported and you would need to go back a long way to find a supported version and use the appropriate browser and driver.
I have tested the driver + browser combination which you show with python and it works as expected. The ChromeDriver 89.0.4389.23 driver should cover all 89... version Chrome browser releases to date.
InvalidArgumentException (Runtime error 0 SeleniumError Invalid Argument):
With reference to the error you saw this post gives the official documentation on it: https://stackoverflow.com/a/59067676
You are seeing this error because you have missed the protocol from your url.
Try the following:
Option Explicit
Private browser As Selenium.ChromeDriver
Public Sub login()
Set browser = New Selenium.ChromeDriver
browser.Get "https://spacequest.procurify.com"
Stop
End Sub

What is the correct IEDriverServer version to use with IE 11 through Selenium

I just got updated to Windows 10 (x64). My old desktop had IE 11 but a lower version, as it was running Windows 7. I now have the following IE version:
Version: 11.648.17134.0
Update Versions: 11.0.115
I downloaded the latest IEDriverServer.exe that Selenium gave me (3.14). When I run it, when I do the get(url) (various urls), afterwards it fails to find elements. I looked and noticed that before the get(), driver.getWindowHandles() had one entry, but after the get() it had zero entries. This is the latest version. I tried setting compatibility mode but that did not do any good (set or not set). The tests will work fine with Chrome but someone else wrote the test and did not verify values were non-null before calling element.sendKeys(str), which IE appears to allow but Chrome throws an exception. And there are so many instances.
So, I need to find the correct IEDriverServer for my Windows 10 IE but I am having trouble doing so. Google did not give me much except it led me to the driver I already downloaded.
Can anyone help?
As a thumb-rule you can always use the released IEDriverServer from the respective released Selenium clients.
As an example,
If you are using Selenium v3.14
Download, extract and use IEDriverServer_Win32_3.14.0.zip or IEDriverServer_x64_3.14.0.zip
Snapshot:
Update
However to work with IE11 you have to take care of a couple of things which are beyond the scope of this discussion and are as follows:
How does the registry entry HKEY_LOCAL_MACHINE\…\FEATURE_BFCACHE for InternetExplorerDriver solves the Internet Explorer 11 issue?
Internet Explorer Protective mode setting and Zoom levels
Selenium InternetExplorerDriver doesn't get focus on the window
How to ignore protected Mode Settings for Internet Explorer using setCapability() through Selenium and Java?

Trying to Automate Chrome with Selenium VBA, automation error?

I am trying to data scrape from a website that is only compatible with Google Chrome. I want to scrape the info into an Excel file so I would like to use VBA to accomplish this.
This is my code.
Sub OpenGoogleChrome()
Dim driver As New WebDriver
driver.Start "chrome", "http://www.google.com"
driver.Get "/"
End Sub
I've tried several variations of this code but I get the same error:
I am just simply trying to open chrome through this automation process so I can utilize it to data scrape later.
I am using Chrome v69, the most recent version of Selenium Basic (2.0.9.0) and I've replaced the Selenium Basic ChromeDriver with the latest version (2.42).
These are my VBA references for my code:
Any help would be much appreciated.
EDIT: I'm using Windows 10 and I do have the necessary .Net framework.
SeleniumBasic requires .NET Framework 3.5. I had the same problem once and activating it on Turn Windows features on and off dialog solved the problem. It worth the try
I faced this error as well, but solved it after I install Selenium via administrator mode.

Firefox is showing "Cannot find firefox binary in PATH." error in MAC OS

Firefox is showing "Cannot find firefox binary in PATH." error in MAC OS.
As per my understanding this issue occurs if the Mozilla is not installed in their default location. I am new in MAC OS
I have also tried with firefox profile and already I have set selenium provided DesiredCapabilities
WebDriver driver = new FirefoxDriver(new FirefoxBinary(new File("/Applications/Firefox.app/Contents/MacOS/firefox-bin")), profile);
I have also tried with different path of mozilla in MAC OS like:-
/Applications/Firefox.app/Contents/MacOS/firefox-bin
/Applications/Firefox.app/Contents/MacOS/firefox
/Applications/Firefox.app
Also please provide a snippet for the same.
Chrome is working fine for me in MAC OS. Only Mozilla is creating problem
Surely, I am missing something. I am attaching the snapshot regarding same.
Also, Is there any method present by which I can locate any application installed location using java code?
According to https://github.com/SeleniumHQ/selenium/wiki/FirefoxDriver there is a property you have to set to set the binary path:
webdriver.firefox.bin
so i assume you have to do following:
System.setProperty("webdriver.firefox.bin","/Applications/Firefox.app/Contents/MacOS/firefox-bin");
WebDriver driver = new FirefoxDriver();
I hope this helps :)
If you have installed firefox, check whether the Firefox application is in the /Applications folder. If not move the application to /Application folder and run the test again.
If above worked, you don't have to add a system property "webdriver.firefox.bin"
Possibly updated for the current situation with this I did this:
Installed geckodriver, available since 2018, to /usr/local/bin (arbitrary choice and made sure it could execute. This placement made it unnecessary to add it to my $PATH.
Installed Firefox to /Applications (I had the developer version)
Added this line to my setUp method: driver = new FirefoxDriver(new FirefoxOptions().setHeadless(true));
All this in macOS 10.11 "Big Sur" (aarch64) using current selenium.

Is there a Selenium WebDriver available for the Microsoft Edge browser?

As of the date of this post the name "Microsoft Edge" has just been officially announced as the default browser for the new Windows 10.
It may be premature to ask but I would like to know if a new Selenium WebDriver is available for it and if not, if there is any telling how long we might expect to wait until we see one developed?
(A technical preview of Windows 10 has already been out so this doesn't seem like a foolish question to me.)
Yes, there is a WebDriver implementation for Microsoft Edge. Its initial availability was announced on 23 July 2015. Language bindings in the Selenium open source project have been updated to take advantage of this driver implementation, and those updates have been released in Selenium 2.47. Note that the Java language bindings were re-released as 2.47.1 to correct an initial issue. The initial implementation has limited functionality, but Microsoft is committed to bringing a fully functional driver implementation to fruition, so updates will be forthcoming.
Microsoft has provided MicrosoftWebDriver which can be used for Edge browser.
Correct version of MicrosoftWebDriver needs to be downloaded, based on the OS Build number
Go to Start > Settings > System > About and note down the OS Build number.
Download the proper version of the driver from this link - https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
If the file that's downloaded is .msi, then install it to get the .exe driver. For one of the release, direct .exe can be downloaded.
Once the MicrosoftWebDriver.exe is downloaded, we can use it in our test script using either System.setProperty("webdriver.edge.driver", "driver location") or using environment variable
The sample script would be like this -
System.setProperty("webdriver.edge.driver","C:\\Program Files (x86)\\Microsoft Web Driver\\MicrosoftWebDriver.exe"); //put actual location
WebDriver driver = new EdgeDriver();
driver.get("your link");
Refer this article for detailed information - http://automationtestinghub.com/selenium-3-launch-microsoft-edge-with-microsoftwebdriver/
The Microsoft Edge driver for Selenium can be automatically downloaded (for Java) using the library webdrivermanager as follows:
EdgeDriverManager.getInstance().setup();
The variable webdriver.edge.driver is also exported by webdrivermanager with the proper path of MicrosoftWebDriver.exe.
"in case it wasn't clear, Microsoft Edge will have WebDriver support. It isn't available today, but is in development Q's? #msedgesummit" tweet from John Jansen the who is - "Microsoft Engineer. Principal Software Engineer (nee Test) Lead on Project Spartan (nee Internet Explorer)."
You can find him on twitter #thejohnjansen and wait for an announcement :)
Prerequisite: Windows 10 is installed on your machine
Download the specified Microsoft WebDriver server version for your build (In my case it is MicrosoftWebDriver.exe for the Operating System: Windows 10 Pro 64-bit (10.0, Build 14393))
Selenium WD Java code for MS Edge is as follows:
System.setProperty("webdriver.edge.driver", "D:\Ripon\MicrosoftWebDriver.exe");
driver = new EdgeDriver();
As of EdgeHTML version 18 (which arrived with Windows version 1809), there is no longer a standalone driver download. You can obtain the new driver in one of two ways:
Start - type "Manage optional features" - Click "Add a Feature" - Find "WebDriver"
Entering the following on an elevated command prompt - "DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0"
https://blogs.windows.com/msedgedev/2018/06/14/webdriver-w3c-recommendation-feature-on-demand/#Qj75uxuFHccPmCW5.97
Legacy versions are still available from:
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
Update:
It appears that version 18 is now legacy and we are back to installing a separate webdriver since the move to Chromium. The link directly above this will still take you to the correct drivers page.
Thanks for your help, I was blocked with my tests, searching for a "EdgeDriver.exe" asked by the selenium EdgeDriver implementation and only find the MicrosoftWebDriver.
I have made this in C# if this can help someone, based on your previous answers :
First, you need to download the MicrosoftWebDriver nuget package, this one will only make a copy of the MicrosoftWebDriver.exe into your destination folder on compilation then
private readonly string _localDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
Environment.SetEnvironmentVariable("webdriver.edge.driver", _localDir + "MicrosoftWebDriver.exe");
var driver = new EdgeDriver();
Hope this can help someone.