SeleniumBasic icon indicating copy to clipboard operation
SeleniumBasic copied to clipboard

Auto close issue

Open meluvalli opened this issue 8 years ago • 5 comments

Using Chrome Version: 51.0.2704.103

When using code to launch chrome and go to webpage in MS Access VBA, chrome automatically closes when code execution has complete.

Is there a way around this from happening?

meluvalli avatar Jul 20 '16 21:07 meluvalli

Insert New Module And Declare Public Variable For Selenium Object

Public selenium As Object 'Late Binding

In Subroutine Or Function Body :

If selenium Is Nothing Then       
    Set selenium = CreateObject("Selenium.WebDriver")
    selenium.AddArgument "--start-maximized"
    selenium.start "chrome", "http://google.com"
End If
selenium.Get "https://github.com/"
...

Sorry For My Poor English

ahmad24shargh avatar Aug 11 '16 22:08 ahmad24shargh

I tried the code above, and still happens. After code is done executing, the Chrome browser is automatically closed. User is unable to interact with Chrome after the code executes.

If I use Selenium-VBA, with the latest ChromeDriver, this doesn't happen. This only started happening with Selenium-Basic.

meluvalli avatar Sep 01 '16 23:09 meluvalli

its the same issue with me and i dint find a solution so far

raviroshan494 avatar Apr 13 '17 07:04 raviroshan494

I also have the same problem, has anyone found the solution?

Alpin10 avatar Mar 10 '23 16:03 Alpin10

For Chrome/Edge, try setting the option "detach" to true.

Here's what the capabilities json should look like for Edge:

{
    "browserName": "msedge",
    "alwaysMatch": {
        "ms:edgeOptions": {
            "detach": true
        }
    }
}

And for Chrome:

{
    "browserName": "chrome",
    "alwaysMatch": {
        "goog:chromeOptions": {
            "detach": true
        }
    }
}

GCuser99 avatar Mar 10 '23 19:03 GCuser99