I have the following python file OpenBrowser.py
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
def openit(browser):
chrome_options = Options()
chrome_options.add_argument("--headless")
desired_capabilities = chrome_options.to_capabilities()
desired_capabilities['acceptInsecureCerts'] = True
driver = webdriver.Chrome()
#driver = webdriver.Chrome("C:\Python27\Scripts\chromedriver.exe", chrome_options=chrome_options,desired_capabilities=desired_capabilities)
driver.get("http://www.python.org")
return browser
and a robot file:
*** Settings ***
Documentation Suite description
Library OpenBrowser.py
*** Test Cases ***
Test title
openit browser
The browser is open, but then it closes and if I want to run another keyword in RF I get error: No brpwser is open
How can I run the python function and keep the browser open?