I’m working on to create a script with 100 some parts and check their certain attribute by clicking on certain tabs. So I thought to get the parts list from a XLSX file but I’m keep getting error variable ${username} not found. ${username} is the Excel sheet first column I’m using just to test this method for my application login. I did add data driver package and ran pip install robotframework-excellib . I did proper spacing. Spending whole day but still couldn’t make this to work. My excel file placed inside Testdata folder and sheet name is Data.xlsx. So I passed the path as below:
Library DataDriver …/Testdata/Data.xlsx . Spent whole lotta tine on this to figure this out but still no success.
Any suggestion please ?
If you uxe XLSX file with datadriver-library, you have to install the Excel support:
Excel Support
For file support of xls or xlsx file you need to install the extra XLS or the dependencies. It contains the dependencies of pandas, numpy and xlrd. Just add [XLS] to your installation. New since version 3.6.
Thank you much for the replies guys. Plz find my code, below. I did run
pip install --upgrade robotframework-datadriver[XLS] and ‘pip install -U robotframework-datadriver[XLS]’ as per the below error
[ ERROR ] Calling method ‘_start_suite’ of listener ‘DataDriver’ failed: ImportError: Requirements (pandas, openpyxl) for XLSX support are not insta
lled.
Use ‘pip install -U robotframework-datadriver[XLS]’ to install XLSX support.
My Exact location of this Excel is : C:\Users\33434555\PycharmProjects\View\Data
Update on this issue :
Now I’m able to read my test excel file ${user} and ${Pwd} but not able to run more test cases with part no reading from same Excel file after I logged in. Scenario is once I login I will enter different parts # then click on few tabs to verify few features then enter another part # and click on few tabls availble under that part # and verify. My set up and code is below . Now It’s just running the 1st test case for Login.
Suite Setup Application Loggin
Suite Teardown Close Browsers
Test Template InvalidLogin
Test Template eVerify Part #2642M72G03
*** Test Cases ***
LoginwithExcel using ${username} ${Pwd}
[Tags] ViewIT home Page Verification
Enter Username ${username} And ${Pwd}
Verify Part #2642M72G03 ${Part}
eVerify Part #2642M72G03
*** Keywords ***
InvalidLogin
[Arguments] ${username} ${Pwd}
Enter Username ${username}
Enter PWD ${Pwd}
eVerify Part #2642M72G03
Application Loggin
[Arguments] ${Part}
Input Text //[@id=“app”]/div/main/div[1]/div[1]/div/input ${Part}
Sleep 2
Click Element //[@id=“app”]/div/main/div[1]/div[1]/div[2]/div/div[1]/div/div[2]/div/div/div/div/div[1]/label/b[1]/span/span/span
sleep 3
Press Keys //b[contains(text(),‘TDP/Drawing Graphics Sheets –’)] Enter
sleep 2
Click Element //label[@for=‘h3V9vv55pgUOLA’]
Wait Until Element Is Enabled //input[@value=‘Download Selected’]