AttributeError:' list'对象没有属性' lower'

时间:2015-10-29 23:18:13

标签: python python-2.7 robotframework

我因以下两个脚本而出现上述错误,原因可能是什么。

*** Settings ***
Resource          resource.txt

*** Variables ***
@{ExpectedCookieValue}    selenium1234
@{ExtractedCookieValue}    ${Empty}

*** Test Cases ***
CookieTest
    Open Browser    http://www.google.com     ${Browser}
    Maximise Browser Window
    Add Cookie    SeleniumTest    selenium1234
    Get Cookie Value    SeleniumTest
    ${ExtractedCookieValue}    Get Cookie Value    SeleniumTest
    Log    "Extracted Cookie Value"
    Log    ${ExtractedCookieValue}
    Should Be Equal    ${ExtractedCookieValue}    ${ExpectedCookieValue}    'Cookie Should Be Equal'
    Close Browser

第二个剧本

*** Settings ***
Resource          resource.txt

*** Test Cases ***
AlertTest
    Open Browser    http://www.seleniummaster.com/robotframeworktest/alerttest.html    ${Browser}
    Sleep    5s
    Click Button    name=alert_button
    Sleep    5s
    Alert Should Be Present    This is an alert box
    Close Browser

1 个答案:

答案 0 :(得分:0)

我定义了一个List变量而不是Scalar。去资源文件和定义标量变量$ {Browser} Firefox 并删除了以下内容  列表变量@ {Browser} Firefox