Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在selenium中的robotframework中打开excel?_Robotframework - Fatal编程技术网

如何在selenium中的robotframework中打开excel?

如何在selenium中的robotframework中打开excel?,robotframework,Robotframework,我一直在尝试使用robotframework打开excel工作表,下面是我尝试的代码: *** Settings *** Library Selenium2Library Library ExcelLibrary *** Variables *** ${path_excel} D:\\Users\\thejav\\Desktop\\pydev.xlsx *** Test Cases *** Test1 Open Ex

我一直在尝试使用robotframework打开excel工作表,下面是我尝试的代码:

*** Settings ***
    Library           Selenium2Library
    Library           ExcelLibrary

*** Variables ***
    ${path_excel}   D:\\Users\\thejav\\Desktop\\pydev.xlsx

*** Test Cases ***
Test1
    Open Excel     ${path_excel}
但是,我得到了这个错误:

FAIL:NotImplementedError:formatting_info=True尚未实现


我认为Excel库还不支持.xlsx类型的Excel文件。因此,您得到了这个错误。您需要将.xlsx文件转换为.xls文件,然后使用


对于xlsx,您可以使用openpyxl库。

将.xlsx文件转换为.xls,同样的代码也可以使用

要转换: 打开exxcel->单击另存为->将扩展名更改为excel 97-2003工作簿