File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -459,6 +459,9 @@ def element_screenshot(element, png_save_path)
459
459
# @return [void]
460
460
def driver_quit
461
461
@driver &.quit
462
+ @driver = nil
463
+ rescue Selenium ::WebDriver ::Error ::WebDriverError
464
+ nil
462
465
end
463
466
alias quit_driver driver_quit
464
467
@@ -521,7 +524,13 @@ def window_rect
521
524
# @return [Selenium::WebDriver] the new global driver
522
525
def start_driver ( http_client_ops =
523
526
{ http_client : ::Appium ::Http ::Default . new , open_timeout : 999_999 , read_timeout : 999_999 } )
524
- @core . driver &.quit
527
+
528
+ # TODO: do not kill the previous session in the future version.
529
+ if $driver. nil?
530
+ driver_quit
531
+ else
532
+ $driver. driver_quit
533
+ end
525
534
526
535
# If automationName is set only in server side, then the following automation_name should be nil before
527
536
# starting driver.
You can’t perform that action at this time.
0 commit comments