More than one excel in a single robot file

16 views
Skip to first unread message

Praneet kumar

unread,
Sep 10, 2023, 2:56:27 PM9/10/23
to robotframework-users
Is there any way to read more than one excel file in a single robot file and run it using template?

I'm trying to run both Invalid and Valid Scenarios from a single robot file but from different excel sheets but only one condition is working.

*** Settings ***
Library SeleniumLibrary
Resource ../Resources/LoginKeywords.robot
Resource ../Resources/CommonKeywords.robot
Library DataDriver ../TestData/TestData.xlsx sheet_name=Sheet1
Library DataDriver ../TestData/TestData.xlsx sheet_name=Sheet2

Test Setup Launch Browser
Test Teardown Close Browser

*** Test Cases ***
LoginTestwithInvalidExcel ${userName} ${password}
[Template] Invalid login
LoginTestwithValidExcel ${userName} ${password}
[Template] Valid login


*** Keywords ***
Valid login

[Arguments] ${userName} ${password}
Enter UserName ${userName}
Enter Password ${password}
Click SignIn
Error message should be visible

Invalid login
sleep 2 sec
[Arguments] ${userName} ${password}
Enter UserName ${userName}
Enter Password ${password}
Click SignIn
sleep 2 sec
Error message should be visible

Reply all
Reply to author
Forward
0 new messages