从目录ROBOT测试用例中获取最新文件名

时间:2016-06-20 07:13:13

标签: robotframework

@{files}=   List Files In Directory     Z:\\    *base*.zip


    ${lastModifiedFile} =   Get From List   ${files}    0
    log to console      Z://${lastModifiedFile}

    @{time1} =  OperatingSystem.Get Modified Time       Z://${lastModifiedFile}


      :FOR    ${file}    IN    @{files}
\       @{time1} =  OperatingSystem.Get Modified Time       Z://${lastModifiedFile}
\       @{time} =   Get Modified Time   ${file}
\       Run Keyword If  ${time1} < ${time}
\       ...     ${lastModifiedFile} ${file}
\       ... ELSE    log to console  ${file}

我已编写此代码以从目录中获取最新文件。它不起作用!!

1 个答案:

答案 0 :(得分:0)

{"cells":[
{
    "type":"basic.Image",
    "position":{
        "x":50,
        "y":350
    },
    "size":
    {
        "width":100,
        "height":50
    },
    "angle":0,
    "id":"4a2802a8-0bd6-4d06-9343-921092a1decd",
    "z":1,
    "attrs":{
        "text":{
            "text":"230004",
            "fill":"black"
        },
        "image":{
            "xlink:href":"/uploads/documents/computer.png",
            "width":100,
            "height":50
        }
    }
}
]}