Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FireFox, Chrome, Edge, Opera Drivers are not working #133

Open
djajal opened this issue Nov 28, 2016 · 25 comments

Comments

Projects
None yet
@djajal
Copy link

commented Nov 28, 2016

I have installed SeleniumBasic-2.0.9.0.exe and did full installation. Only IE and PhantomJs drivers are working and others are not working. I have Excel 2016 64 bit and Excel 2007 32 bit running on Windows 10 64bit . Same issue on both excel versions.

@fjjlee

This comment has been minimized.

Copy link

commented Nov 28, 2016

I have been having problems getting mine to work for the past week or two. It just goes to a blank screen when trying to open any page in chrome. It was working fine for months before that.

@ranjithkumar8352

This comment has been minimized.

Copy link

commented Nov 29, 2016

Not sure about other browsers but chrome driver in the latest version of selenium Basic is outdated.

I looked into the chrome driver version and found out that it’s v 2.21while the latest version with bug fixes for chrome 54 is v 2.25.

Selenium wrapper installer comes with v 2.21 so we have to manually update the driver.

First download chrome driver 2.25 from here – https://sites.google.com/a/chromium.org/chromedriver/downloads then go to your selenium path – C:\Users\username\AppData\Local\SeleniumBasic and replace the chrome driver with the latest one and it should work fine.

@fjjlee

This comment has been minimized.

Copy link

commented Nov 29, 2016

I updated the chromedriver.exe file as suggested in one of the other issues posted but that alone did not fix it. I had to update my call to the driver as well:

Dim driver As SeleniumWrapper.webdriver
Set driver = New SeleniumWrapper.webdriver
driver.Start "chrome", "https://www.google.com"
driver.Open ("https://www.google.com")

@ranjithkumar8352

This comment has been minimized.

Copy link

commented Nov 29, 2016

Glad it worked, I don't know how you were calling it previously. You can find more examples here -

@mogulman52

This comment has been minimized.

Copy link

commented Dec 1, 2016

I posted how to get Edge working. Go here.

To get Firefox working you need to downgrade to Firefox 46.0.1. Disable auto updates.

This is a great product. I would pay for it. I am hoping it is updated soon.

@djajal

This comment has been minimized.

Copy link
Author

commented Dec 1, 2016

@umair10

This comment has been minimized.

Copy link

commented Dec 16, 2016

Hi,

I am getting some issue when i use my macro on one of my computer :

Firefox opens but it doesnt open the URL I gave and I get an error.

On my other computer it works perfectly.

The difference between these the computer is the Firefox version.

On the working one, FF version is 39
On the NOT working one, FF version is 49.

I read that upper FF 47 Webdriver is no more supported. The new driver is "Marionette" but I can't find how to make it work with VBA.

Have you any idea to make my automation work on my both computer ?

Here my code :

`Public Sub Mozilla()

Dim driver As New Selenium.WebDriver

Dim i As Integer, j As Integer
Dim dems As String

driver.Start Sheets("Paramètres").Range("POD_NAV")
driver.Get Sheets("Paramètres").Range("POD_URL")
driver.FindElementById("P101_USERNAME").SendKeys Sheets("Paramètres").Range("POD_LOGIN")
driver.FindElementById("P101_PASSWORD").SendKeys Sheets("Paramètres").Range("POD_PWD")
driver.FindElementById("P101_LOGIN").Click

End Sub`

@mogulman52

This comment has been minimized.

Copy link

commented Dec 17, 2016

You need to downgrade to FF v.46.0.1. I looked at the code in hopes of updating it but I am lost on how to change/debug it.

@umair10

This comment has been minimized.

Copy link

commented Dec 17, 2016

I dreaded this answer...
so sad to donwgrade the system in order to make it work. It sounds so bad, to hear that you have to not follow the progress but look at the back.
Anyway I will do it in order to make it work.

Otherwise if someone find anything, they are welcome. By the way no marionette for selenium vba ?

@diracsbracket

This comment has been minimized.

Copy link

commented Jan 13, 2017

ChromeDriver does not work on Windows 7 x64.

Run-time error ''33'
SesssionNotCreatedError
session not created exception
from uknown error: Runtime.executionContextCreated has invalid 'context':
{"auxData":{"frameId":1596.1","isDefault":true),"id":1,"name":"",....

FireFox does not work. Installed latest version 50.1.0, and get following error:

Run-time error '21':
TimeoutError
Firefox failed to open the listening port 127.0.0.1.:53143 within 15s
Disabled Firewall, still same problem.

@mogulman52

This comment has been minimized.

Copy link

commented Jan 13, 2017

Please read all comments in this post. Upgrade Chrome driver and downgrade to FF 46.0.1

@Libana00

This comment has been minimized.

Copy link

commented Jan 27, 2017

the "only" problem seems to be the gecko driver, isn´t it possible to handle it by adding some kind of

GeckoDriverService service =new GeckoDriverService.Builder(firefoxBinary)
.usingDriverExecutable(new File("path to geckodriver"))
.usingAnyFreePort()
.usingAnyFreePort()
.build();
service.start();

in the .....\Selenium\Drivers\FirefoxDriver.cs, as seen on (http://www.seleniumhq.org/docs/04_webdriver_advanced.jsp) ...?!?!?

@mogulman52

This comment has been minimized.

Copy link

commented Jan 28, 2017

I tried this a while back. I only spent a few hours on it. I wasn't able to get NUnit tests working. I don't really understand some things so I was guessing. If I get motivated I might spend some more time on it.

` [ProgId("Selenium.FirefoxDriver")]
[Guid("0277FC34-FD1B-4616-BB19-14DB1E4916D4")]
[ComVisible(true), ClassInterface(ClassInterfaceType.None)]
public class FirefoxDriver : WebDriver, ComInterfaces._WebDriver
{
const string BROWSER_NAME = "firefox";

    /// <summary>
    /// 
    /// </summary>
    public FirefoxDriver()
        : base(BROWSER_NAME) { }

    internal static IDriverService StartService(WebDriver wd)
    {
        ExtendCapabilities(wd, false);

        var svc = new DriverService();
        svc.AddArgument("--host=localhost");
        svc.AddArgument("--port=" + svc.IPEndPoint.Port.ToString());
        svc.Start("geckodriver.exe", true);
        return svc;
    }

    internal static void ExtendCapabilities(WebDriver wd, bool remote)
    {
        Capabilities capa = wd.Capabilities;

        Dictionary opts;
        if (!capa.TryGetValue("firefoxOptions", out opts))
            capa["firefoxOptions"] = opts = new Dictionary();
    }
}

}`

@pippoxpippo

This comment has been minimized.

Copy link

commented Jan 3, 2018

Dear mogulman52
please clarify how to use your suggested code in order to handle the geckodriver.exe and where to find the geckodriver.exe?

@quentinharris

This comment has been minimized.

Copy link

commented Oct 7, 2018

Any update on this please? Any plans to update to handle latest FireFox ?

@mouhammadzaheralshaar

This comment has been minimized.

Copy link

commented Dec 30, 2018

I am have the same problem, any idea plz

@mogulman52

This comment has been minimized.

Copy link

commented Dec 31, 2018

If you update the Chrome and Edge drivers it seems to work fine. SeleniumBasic installs at:
C:\Users<user>\AppData\Local\SeleniumBasic

Get correct Chrome webdriver and replace it. It has to have same name. https://sites.google.com/a/chromium.org/chromedriver/downloads

Get correct Edge webdriver and replace it. You'll need to rename it. https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/#downloads

Firefox doesn't work unless you use version 46.1.0 (very old).

@pippoxpippo

This comment has been minimized.

Copy link

commented Jan 2, 2019

Dear mogulman52.
The issue on FF 48+ was submitted one year ago with title: "Firefox 48+ not working with SeleniumBasic (#162)".
Your reply at that time was:

"The last FF release that works with SeleniumBasic is 46.0.1. When FF switched to the new GeckoDriver it broke. I tried to adapt SB to the new FF driver but there are several things I don't understand and I wasn't successful. I haven't seen any postings from Florent Breheret so I assume he has lost interest in this product. It is a great product and I hate to see it abandoned. I'll probably try again to get it working. If I can't maybe I'll do a dll from Excel to .Net. Selenium works with C# and FF. "

Can you please give an update on this (dll or anithing else)?.

@mde00435

This comment has been minimized.

Copy link

commented Jul 12, 2019

Dear mogulman52.
The issue on FF 48+ was submitted one year ago with title: "Firefox 48+ not working with SeleniumBasic (#162)".
Your reply at that time was:

"The last FF release that works with SeleniumBasic is 46.0.1. When FF switched to the new GeckoDriver it broke. I tried to adapt SB to the new FF driver but there are several things I don't understand and I wasn't successful. I haven't seen any postings from Florent Breheret so I assume he has lost interest in this product. It is a great product and I hate to see it abandoned. I'll probably try again to get it working. If I can't maybe I'll do a dll from Excel to .Net. Selenium works with C# and FF. "

Can you please give an update on this (dll or anithing else)?.

Do we know if there was ever a fix for using selenium basic with FF 48 or greater?

@mouhammadzaheralshaar

This comment has been minimized.

Copy link

commented Jul 15, 2019

@mogulman52

This comment has been minimized.

Copy link

commented Jul 15, 2019

I've given up on FF. There is too much I don't understand. If I need FF I use C#. I got dragged into a big project and didn't have time. I did get SB to work with EDGE. It is a convoluted process. You start Edge, get process id and connect to Edge.

@daluu

This comment has been minimized.

Copy link

commented Jul 15, 2019

For those waiting on this issue, do you have to or must use VBA? Because there's a VBScript alternative that may be close enough for your needs (I didn't check the exact functionalities between the two though, or what bugs each may have). You might also be able to call the VBScript code from VBA too.

http://htejera.users.sourceforge.net/vbswebdriver/

and in case not, perhaps it might be easier to fix that solution for FF (and Chrome) support than this project.

@pippoxpippo

This comment has been minimized.

Copy link

commented Jul 16, 2019

@ScoobyQ

This comment has been minimized.

Copy link

commented Jul 16, 2019

For those waiting on this issue, do you have to or must use VBA? Because there's a VBScript alternative that may be close enough for your needs (I didn't check the exact functionalities between the two though, or what bugs each may have). You might also be able to call the VBScript code from VBA too.

http://htejera.users.sourceforge.net/vbswebdriver/

and in case not, perhaps it might be easier to fix that solution for FF (and Chrome) support than this project.

I still need to use with VBA.

@mogulman52

This comment has been minimized.

Copy link

commented Jul 16, 2019

Here is how you connect to EDGE using SB. I didn't create this solution.

`
Option Explicit

Public Sub Sample()
Dim pid As Long
Dim pno As Long: pno = 17556

pid = StartEdgeDriver(PortNo:=pno)
If pid = 0 Then Exit Sub
With CreateObject("Selenium.WebDriver")
.StartRemotely "http://localhost:" & pno & "/", "MicrosoftEdge"
.Get "https://www.bing.com/"
.FindElementById("sb_form_q").SendKeys "abcdefg"
MsgBox "pause", vbInformation + vbSystemModal
.Quit
End With
TerminateEdgeDriver pid
MsgBox "done.", vbInformation + vbSystemModal
End Sub

Private Function StartEdgeDriver( _
Optional ByVal DriverPath As String = "C:\Windows\System32\MicrosoftWebDriver.exe", _
Optional ByVal PortNo As Long = 17556) As Long

Dim DriverFolderPath As String
Dim DriverName As String
Dim Options As String
Dim itm As Object, itms As Object
Dim pid As Long: pid = 0

With CreateObject("Scripting.FileSystemObject")
If .FileExists(DriverPath) = False Then GoTo Fin
DriverFolderPath = .GetParentFolderName(DriverPath)
DriverName = .GetFileName(DriverPath)
End With

'check already running process
Set itms = CreateObject("WbemScripting.SWbemLocator").ConnectServer.ExecQuery _
("Select * From Win32_Process Where Name = '" & DriverName & "'")
If itms.Count > 0 Then
For Each itm In itms
pid = itm.ProcessId: GoTo Fin
Next
End If

'execute WebDriver
Options = " --host=localhost --jwp --port=" & PortNo
With CreateObject("WbemScripting.SWbemLocator").ConnectServer.Get("Win32_Process")
.Create DriverPath & Options, DriverFolderPath, Null, pid
End With

Fin:
StartEdgeDriver = pid
End Function

Private Sub TerminateEdgeDriver(ByVal ProcessId As Long)
Dim itm As Object, itms As Object

Set itms = CreateObject("WbemScripting.SWbemLocator").ConnectServer.ExecQuery _
("Select * From Win32_Process Where ProcessId = " & ProcessId & "")
If itms.Count > 0 Then
For Each itm In itms
itm.Terminate: Exit For
Next
End If
End Sub

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.