I want to use selenium webdriver methods in the robot framework library.
def custom_go_to
driver = BuiltIn().get_library_instance('SeleniumLibrary')
driver.go_to(url)
The above code from custom library works fine, but I want to use selenium method at the place of robotframework builtin library. When I try to use driver.get(url) it says
'SeleniumLibrary' object has no attribute 'get'
The custom library I created ERP.py looks like
class ERP:
@keyword
def custom_go_to(self, url):
driver = BuiltIn().get_library_instance('SeleniumLibrary')
driver.get(url)
And Test Case looks like
***Settings***
Library SeleniumLibrary
Library path_to_lib/ERP.py
*** Variable ***
${BROWSER} | chrome
${URL} | facebook.com
***Test Cases***
Open the browser using an inbuilt keyword and go to a given URL using custom go to using EventFiringWebDriver.
Open Browser | about:blank | ${BROWSER}
Custom Go To | ${URL}
How can I use Selenium webdriver methods inside the robot framework library?
SeleniumLibrary
does not haveGet
keyword... Please try again with an existing keyword. – asprtrmpGet
keyword inSeleniumLibrary
... – asprtrmp