问题
How can I open excel file through ride in robot framework. I am trying to Open Excel keyword but I am keep getting error "No such file or directory".
回答1:
You can follow my sample code below :
*** Settings ***
Library Selenium2Library
Library ExcelLibrary
*** Variables ***
${path_excel} res/my_excel_file.xls
*** Test Cases ***
Test1
Open Excel ${path_excel}
回答2:
Also, another option if you prefer not to use a variable for the excel file -> Just store the excel file in the same folder as your project and one important thing to mention is that RIDE - Robot Framework does not support excel files that have the extension of .xlsx, if your excel file is .xlsx format, you will need to open it in excel and do a file save as .xls which is the older format. Once you do this and store the .xls file to your project folder (Which is usually in C:\Python27\Scripts\ProjectFolderName) you can use the following just replace the test.xls with the name of your .xls file:
*** Settings ***
Library SeleniumLibrary
Library ExcelLibrary
*** Test Cases ***
Test1
Open Excel Current Directory test.xls
来源:https://stackoverflow.com/questions/48511733/how-can-i-open-excel-file-through-ride-in-robot-framework