Reputation: 131
I have Myvariable.yaml file and sample.robot file, I wanted to use the variables from .yaml file to robot file
Myvariable.yaml file:
ACFC NEWS:
Doc_Title: XPath=//div[@class='ng-scope']
Open_Selector: xpath=//button[@class='btn btn-default ng-binding]
Sample.robot file
***Settings****
Variables Myvariable.yaml
***Keywords****
Choose Topic:
Input Text ${Doc_Title} "Some text"
Click Button ${Open_Selector}
Error: Variable not found
It would be great if any one can help me in solving this issue.
Upvotes: 3
Views: 21205
Reputation: 2615
you need to access the attributes of yaml file like ${DICT.one}
more information here
your modified code
*** Settings ***
Variables Myvariable.yaml
*** Test Case ***
Test
Choose Topic
***Keywords****
Choose Topic
Log ${ACFC NEWS.Doc_Title}
Log ${ACFC NEWS.Open_Selector}
I am assuming you are running the script with below command
pybot -V myvariable.yaml sample.robot
This should solve your problem now.
Upvotes: 8