Unable to run for different browsers using --Variable of Robot Framework

Hi,

In the commonResource.robot i have specified the Browser as variable and assigned to chrome, but when i tried to run from the terminal using the below command

C:\Users\rajre\PycharmProjects\Automation>robot --variable Browser:firefox TestCases\LoginTest.robot

rows error as **"SessionNotCreatedException: Message: Unable to find a matching set of capabilities "

Note: I have kept the geckodriver.exe at location C:\Users\rajre\PycharmProjects\Automation\venv\Scripts

LoginKeywords.robot:
*** Settings ***
Library Selenium2Library
Variables …/PageObjects/Locaters.py

*** Keywords ***
Open my Browser
[Arguments] {AppUrl} {Browser}
open browser {AppUrl} {Browser}
maximize browser window

Input UserName
[Arguments] {Username} input text {txt_loginUserName} ${Username}

Input Pwd
[Arguments] {Password} input text {txt_loginPassword} ${Password}

Click Login Button
click button ${btn_Login}

Verify Message
should contain Password cannot be empty Password cannot be empty
should contain Username cannot be empty Username cannot be empty
should contain Invalid credentials Invalid credentials
should contain Dashboard Dashboard

LoginTest.robot
*** Settings ***
Library Selenium2Library
Resource …/Resources/LoginKeywords.robot
Resource …/Resources/commonResource.robot
Library DataDriver …/TestData/LoginTestData.xlsx

Suite Setup Open my Browser {AppUrl} {Browser}
Suite Teardown Close Browser
Test Template Login Validation
*** Test Cases ***

LoginTest
Login Validation

*** Keywords ***
Login Validation
[Arguments] {Username} {Password}
Input UserName {Username} sleep 1 Input Pwd {Password}
sleep 1
Click Login Button
sleep 1
Verify Message

LoginTest.robotI have tried this way too, but no luck
Suite Setup Open my Browser {AppUrl} browser={Browser}
C:\Users\rajre\PycharmProjects\Automation>robot --variable browser:firefox TestCases\LoginTest.robot

Thanks,
Rajani

Hi, I think it’s because the variables are missing the $ prefix. Ex:
Suite Setup Open my Browser ${AppUrl} ${Browser}

Edit: or maybe it’s just that the forum ate the $ :smiley: