Is there a way to keep the browser window open after the test execution in RobotFramework? [closed]

巧了我就是萌 提交于 2019-12-02 13:00:15

Simple - do not call Close Browser at the end.

Ideally, the WebDriver service should stop once your script ends due to this code.

However if you want Chrome and ChromeDriver to stay open afterwards, you can add the experimental option detach when initializing the chromedriver.

Through Selenium-Python client you can:

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_experimental_option("detach", True)
driver = webdriver.Chrome(chrome_options=options, executable_path=r'C:\WebDrivers\chromedriver.exe')
driver.get('https://www.google.com/')

In a previous Stack Overflow question about connecting to the Chrome remote-debugging-port I provided an example for connecting to a running chrome instance using it's Dev Port.

This will functionally do what you want and as such may be an alternative to no closing as suggested by @Todor and @Bryan.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!