Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Selenium by (7k points)

I like to use selenium webdriver methods in the robot framework library.

def custom_go_to

        driver = BuiltIn().get_library_instance('SeleniumLibrary')


The above code works fine, but I want to use selenium method in place of robotframework builtin library. When I use driver.get(url) it says

'SeleniumLibrary' object has no attribute 'get'

The custom library looks like

class ERP:


    def custom_go_to(self, url):

        driver = BuiltIn().get_library_instance('SeleniumLibrary')


And Test Case looks like



Library  SeleniumLibrary

Library  path_to_lib/

*** Variable ***

${BROWSER}  |  chrome

${URL}  |

***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 to use webdriver methods inside robot framework library?

1 Answer

0 votes
by (31.9k points)

Use selenium webdriver methods inside Robotframework

You should get a reference to driver-an attribute in the library.

def custom_go_to(url):

    selib = BuiltIn().get_library_instance('SeleniumLibrary')


Want to learn Selenium, checkout our Selenium training.

Related questions

Browse Categories