selenium-webdriverwebdriverrobotframeworkselenium2library

Selenium Robot framework - webdriverexception : geckodriver executable needs to be in path


could anyone help please, I have this code:

*** Settings ***
Library Selenium2Library

*** Variables ***
${BROWSER}  ff
${WEBSITE}  http://www.google.com

*** Test Cases ***

Browser test
    [Documentation] Google site.
    [Tags]  Tag.
    Open Browser    ${WEBSITE}  ${BROWSER}
    Close Browser

I think code is correct, but i get this error: webdriverexception message 'geckodriver' executable needs to be in path

I have:

I don't know, how to install webdriver? How to put it to the PATH?

I have no idea what's going on here, nowhere any guide. - I found only this, but don't understand, how to install that? How set the path? A what should I do with that code?


Solution

  • I don't know, how to install webdriver? How to put it to the PATH?

    Actually now Selenium is supporting executable geckodriver.exe to launch Mozilla Firefox >= v47 just like other drivers.

    To work around you need to download executable geckodriver.exe v0.8.0 for 32bit and extract downloaded zip into your system at any location and set Syetem property with webdriver.gecko.driver to point with download executable geckodriver location as below :-

    ** Settings ***
    Library  OperatingSystem
    *** Keywords ****
    Set Environment Variable  webdriver.gecko.driver  path/to/geckodriver.exe