-1
${file} Normalised Path _downloads
{Filename} get file name important file xlsx true

Open Excel Document ${file}/${filename} importantfile

${Sheet1} Get Sheet review

${Exceldata} create list

For ${row} IN @{sheetvalues}
    Continue for loop if ${row}[0]=='date'

Append to list ${exceldata} ${row}

END

这仅为一张纸提供价值。如何获取多张工作表的数据

4

1 回答 1

0

解决方案很简单。

1/ 第一步是安装库:

$ pip install robotframework-excellib

https://pypi.org/project/robotframework-excellib/

还有另一个 ExcelLibrary,但Python 3.x 不支持这个。

2/ 创建一个示例测试用例:

*** Settings ***
Library    ExcelLibrary     

*** Test Cases *** 
Read Excel
    Open Excel Document    test.xlsx    doc_id=test
    ${value}=    Read Excel Cell    1    1    List2
    Log To Console    ${value} 

这里的重点是先打开 Excel 文档,然后从特定的工作表中读取一个单元格值。您想要的工作表被指定为Read Excel Cell.

一切都有据可查:https ://rawgit.com/peterservice-rnd/robotframework-excellib/master/docs/ExcelLibrary.html

于 2020-08-19T11:45:49.700 回答