【发布时间】:2020-11-23 13:09:50
【问题描述】:
我正在尝试使用当前时间更新一个 Excel 文件中的列。
为了完成它,我使用来自 DateTime 库的 Get Current Date 关键字并将其存储到下面脚本中的标量 ${datetime}
*** Settings ***
Default Tags Download_File
Library SeleniumLibrary
Library ExcelLibrary
Resource Userdefinedkeywords.txt
Library DateTime
Run Keyword If ${countt}>0 Run Keywords Click Element xpath://[@id="fileSubmit"]/div[1]/img
... AND Open Excel D:\\RPA\\Demo\\Excelx.xls
... AND Put String To Cell Test 2 ${countd} ZIP FILE
... AND Save Excel D:\\RPA\\Demo\\Excelx_DONE.xls
... ELSE IF ${countt2}>0 Run Keywords Click Element xpath://*[@id="plsAttachGrid_0_1"]/img
... AND ${datetime}= Get Current Date
... AND Open Excel D:\\RPA\\Demo\\Excelx.xls
... AND Put String To Cell Test 2 ${countd} SINGLE FILE
... AND Put String To Cell Test 3 ${countd} ${datetime}
... AND Save Excel D:\\RPA\\Demo\\Excelx_DONE.xls
... ELSE Run Keywords Open Excel D:\\RPA\\Demo\\Excelx.xls
... AND Put String To Cell Test 2 ${countd} NO FILE
${countd}= Evaluate ${countd}+${1}
我收到以下错误:
FAIL : No keyword with name '=' found.
部分代码运行时:
... AND ${datetime}= Get Current Date
代码有什么问题? 提前致谢
【问题讨论】:
标签: python-2.7 datetime robotframework