File tree Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -491,12 +491,25 @@ protected override void Dispose(bool disposing)
491491
492492 if ( this . SessionId is not null )
493493 {
494- this . Execute ( DriverCommand . Quit , null ) ;
495-
496- this . SessionId = null ;
494+ try
495+ {
496+ this . Execute ( DriverCommand . Quit , null ) ;
497+ }
498+ catch ( NotImplementedException )
499+ {
500+ }
501+ catch ( InvalidOperationException )
502+ {
503+ }
504+ catch ( WebDriverException )
505+ {
506+ }
507+ finally
508+ {
509+ this . SessionId = null ;
510+ }
497511 }
498512
499-
500513 if ( this . disposeDriverService )
501514 {
502515 this . driverService . Dispose ( ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ public void ChromeImplicitly()
1414 {
1515 using ( var driver = new ChromeDriver ( ) )
1616 {
17-
17+ driver . Close ( ) ;
18+ driver . Quit ( ) ;
19+ driver . Dispose ( ) ;
1820 }
1921
2022 Assert . That ( Process . GetProcessesByName ( "chromedriver" ) , Is . Empty ) ;
@@ -55,7 +57,9 @@ public void FirefoxImplicitly()
5557 {
5658 using ( var driver = new FirefoxDriver ( ) )
5759 {
58-
60+ driver . Close ( ) ;
61+ driver . Quit ( ) ;
62+ driver . Dispose ( ) ;
5963 }
6064
6165 Assert . That ( Process . GetProcessesByName ( "geckodriver" ) , Is . Empty ) ;
You can’t perform that action at this time.
0 commit comments