SeleniumBasic
SeleniumBasic copied to clipboard
Auto close issue
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?
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
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.
its the same issue with me and i dint find a solution so far
I also have the same problem, has anyone found the solution?
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
}
}
}