I'm starter in Python and Robot framework. I'm trying to create and learn to use custom library in my robot framework test suite.
I have created a custom library with the following code:
from selenium import webdriver
import time
class CustomLibrary:
def Open_My_Browser(self):
browser = webdriver.Chrome()
browser.maximize_window()
browser.get("http://demo.guru99.com/V4/")
time.sleep(5)
I imported this custom library and had specified the keyword "Open My Browser". This keyword executes the code from my custom library but the next steps are from selenium2library like click button.
The execution stops and i get message "No browser is open". I understood that my selenium2library is not recognizing the browser which is opened by my customlibrary. But I'm not able to fix this problem. Can anyone please shed some advice
My robot file:
Documentation Test the Guru99 Banking Website
Library Selenium2Library
Library CustomLibrary.py
*** Test Cases ***
Test Case: 001 - The user should be able to navigate to Guru99
[Tags] Smoke
Open the Guru99 website
*** Keywords ***
Open the Guru99 website
Open My Browser ```