Help regarding Robot Framework in Pycharm

Hello All,

I am new to Robot Framework. I have Windows 10 OS and Pycharm installed on the same. I have recently installed the plugin for Robot Framework in Pycharm. Trying to test basic stuff but getting this error:

WebDriverException: Message: ‘geckodriver’ executable needs to be in PATH. Here’s the part of code snap:

Documentation This is a test suite with Robot Framework for message board
Library Selenium2Library

*** Variables ***
{SERVER} http://127.0.0.1:5000/ {BROWSER} chrome
${DELAY} 1

*** Keywords ***

*** Test Cases ***
Flask Test
Open Browser http://127.0.0.1:5000/ chrome
[Teardown]. Close Browser

Few things that stand out…

  • First off, do not use Selenium2Library, it is just SeleniumLibrary. Selenium2Library is really just a “proxy” for backwards compatibility for people who where using it when it was a thing. New code does not need to use it.
  • Your example vs the error message - you are passing “chrome” as browser but the error message indicates that Open Browser keyword is trying to open Firefox (eg, error message about missing geckodriver, which is webdriver for Firefox). Most likely, you dont have enough spaces between the url and the browser name … Which is hard to determine also because formatting of the code block isn’t correct.
  • Once you fix the space issue from above, did you install chromedriver ? Do check GitHub - robotframework/SeleniumLibrary: Web testing library for Robot Framework.

*** Settings ***
Library SeleniumLibrary

*** Variables ***
{SERVER} http://127.0.0.1:5000/create {BROWSER} firefox
{TITLE} create message {MESSAGE} How are you?
{SENDER} Niladri {URL} www.google.com
${NOTIFICATION} Message has been sent!

*** Test Cases ***

create message
Open Browser to Index Page
Input Title
Input Message
Input Sender
Input Url
Click Submit
Message is created
[Teardown] Close Browser
*** Keywords ***
Open Browser to Index Page
Open Browser ${SERVER}

Input Title
[Arguments] {TITLE} Input Text title {TITLE}

Input Message
[Arguments] {MESSAGE} Input Text message {MESSAGE}

Input Sender
[Arguments] {SENDER} Input Text sender {SENDER}

Input Url
[Arguments] {URL} Input Text url {URL}

Click Submit
Click Button send

Message is Created
Text Should Be ${NOTIFICATION}

Error:
Keyword ‘Input Title’ expected 1 argument, got 0.