PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, July 9, 2022

[FIXED] How to integrate embedded variables on RobotFramework Keywords

 July 09, 2022     keyword, python, robotframework, selenium     No comments   

Issue

I would like to know how to do something like this:

Resource File:

*** Settings ***
Library SeleniumLibrary

*** Keywords ***

Open Outdoor Menu
   Click Element  id:outdoor_menu

Check Outdoor Monitor Specs
    Page Should Contain Element  id:outdoorpossible

Check Monitors Specs
    [Arguments]   ${Menu}
    Open ${Menu} Menu
    Check ${Menu} Monitor Specs

I have different ${Menu} monitors and something like this would be really helpful. So my test would be like this:

...
Test Template   Check Monitors Specs

*** Test Cases ***
Outdoor Menu  Outdoor
Station Menu  Station
etc.

I try this and gives me this error : " no keyword with name 'Open ${Menu} Menu' found. " Do you have any ideas on how can i implement something like this? Many thanks


Solution

You need to use "Run Keyword"

Check Monitors Specs
   [Arguments]   ${Menu}
   Run Keyword  Open ${Menu} Menu   
   Run Keyword  Check ${Menu} Monitor Specs


Answered By - Matthew King
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing