You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A very strange bug occurs when combining the browser detach option of WebCapabilities class with a command window style that is NOT vbHide or vbMinimizedNoFocus. If any one of the other command window styles is used, then the browser closes on shutdown. Happens with both Chrome and Edge...
Subtest_detach_browser()
'use this if you want browser to remain open after shutdown clean-up - only for Chrome/EdgeDim driver AsSeleniumVBA.WebDriver
Dim caps AsSeleniumVBA.WebCapabilities
Set driver = SeleniumVBA.New_WebDriver
'for detach to function properly, must use either vbHide (Default) or vbMinimizedNoFocus'driver.CommandWindowStyle = vbHide '<-- this works fine
driver.CommandWindowStyle = vbNormalFocus '<-- using this will close the browser on shutdown
driver.StartChrome
Set caps = driver.CreateCapabilities(initializeFromSettingsFile:=False)
'this sets whether browser is closed (false) or left open (true)'when the driver is sent the shutdown command before browser is closed'defaults to false'only applicable to edge/chrome browsers
caps.SetDetachBrowser True
driver.OpenBrowser caps
driver.NavigateTo "https://www.wikipedia.org/"
driver.Wait 1000'driver.CloseBrowser 'detach does nothing if browser is closed properly by user
driver.Shutdown
End Sub
The text was updated successfully, but these errors were encountered:
WebCapabilities class:
- Added AddLocalStateFlags method to WebCapabilities class as a shortcut for adding experimental browser flags - Chrome/Edge only [@Silver-Surfer, #63]
- Added Error handling to SetDetachBrowser method to solve issue #82
- Added Friend property Get CommandWindowStyle to WebDriver class for use in SetDetachBrowser error handling
WebDriver class:
- Added SetDownloadFolder method for setting download folder w/o needing to set in capabilities - Chrome/Edge only
- Added "Set lastElems = Nothing" to Shutdown method so that terminate event of WebDriver class fires
WebDriver/WebElement classes:
- Added maxWaitTimeMS argument/functionality to IsDisplayed, IsSelected, and IsEnabled methods
ActiveX DLL solution:
- Removed Err.Raise bug work-around after bug fixed in twinBASIC compiler
twinBASIC banner (at least for now) no longer displays for 5 secs at startup
- Added 32-bit support for >= Office 2010
Minor Code Cleanups
A very strange bug occurs when combining the browser detach option of WebCapabilities class with a command window style that is NOT vbHide or vbMinimizedNoFocus. If any one of the other command window styles is used, then the browser closes on shutdown. Happens with both Chrome and Edge...
The text was updated successfully, but these errors were encountered: