I have 1000 URL names to send to robot test. So that I have planned to assign each URL to a variable called ${ URL1}, ${URL2}... etc. When I use this inside "test.robot" its working as expected. But When I call these variables from resource file I am getting "resources.txt' is empty" error as shown in below logs.
[ WARN ] Imported resource file 'C:\Users\test\Desktop\IMPORTANT - Robot Fram
work - Final Project Data\URL\resources.txt' is empty.
==============================================================================
Url based apps test suite
==============================================================================
testcase1 | FAIL |
Variable '${URL1}' not found.
------------------------------------------------------------------------------
testcase2 | FAIL |
Variable '${URL2}' not found.
------------------------------------------------------------------------------
Url based apps test suite | FAIL |
2 critical tests, 0 passed, 2 failed
2 tests total, 0 passed, 2 failed
==============================================================================
resources.txt contents:
${URL1} http://www.4shared.com/
${URL2} http://depositfiles.com/
${URL3} https://www.gmail.com/
test.robot settings content:
*** Settings ***
Library Selenium2Library
Library SSHLibrary
Suite Teardown Close All Browsers
Resource resources.txt
Please help to me fix this issue.
Thanks in advance
Your resources.txt should start with the "variables" header:
*** Variables ***
${URL1} http://www.4shared.com/
${URL2} http://depositfiles.com/
${URL3} https://www.gmail.com/
See Resource file structure in the User Guide: "The higher-level structure of resource files is the same as that of test case files otherwise".
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments