【问题标题】:I am getting following error: TypeError: 'bool' object is not subscriptable我收到以下错误:TypeError: 'bool' object is not subscriptable
【发布时间】:2020-08-05 11:11:27
【问题描述】:

我收到以下错误:TypeError: 'bool' object is not subscriptable

*** Settings ***

Library        AppiumLibrary
Resource       ../../Resources/Library.robot

Documentation    Test Cases for Login module
# Test Setup    User_open_application
# Test Teardown     User_close_application
default tags    DFLT
force tags     ALL_TC
test timeout     2mins

*** Test Cases ***
TC_001- Application start and close
#  [Setup]    User_Open_Application
#  log    ${Res}
[Tags]    Regression
User_open_application
${username_text} =    Read_Element_Locator    login.username_textbox_xpath
${paswword_text} =    Read_Element_Locator    login.password_textbox_xpath
${send_button} =    Read_Element_Locator    login.login_button_id
${account_section} =    Read_Element_Locator    login.account_button_xpath
${logout} =    Read_Element_Locator    login.logout_xpath
Input Text    xpath=${username_text}    globaladmin
Input Text    xpath=${paswword_text}    Dassen!985
Click Element    id=${send_button}
Sleep    30
capture page screenshot  D:/pycharm/PyCharm Community Edition 2019.3.4/camobile/Snapshots/TC_001.png
Click Element    xpath=${account_section}
Click Element    xpath=${logout}
sleep    5
User_close_application
#[Teardown]    User_Close_application

我收到以下错误:TypeError: 'bool' object is not subscriptable , while execution the robotsframework (python version 3.8)

【问题讨论】:

  • 我们需要知道错误发生在哪里。在什么关键字上?它是否生成了 log.html?
  • 状态:失败(严重)消息:TypeError:'bool' 对象不可下标 00:00:30.619KEYWORD 库。 User_open_application 00:00:00.008KEYWORD ${username_text} = 库。 Read_Element_Locator login.username_textbox_xpath 开始/结束/经过:20200422 14:40:47.847 / 20200422 14:40:47.855 / 00:00:00.008 00:00:00.008KEYWORD ${result} = 定位器。从 Json ${JsonPath} 读取定位器开始/结束/经过:20200422 14:40:47.847 / 20200422 14:40:47.855 / 00:00:00.008 14:40:47.855 FAIL TypeError: 'bool' object is not subscriptable跨度>

标签: robotframework appium-android python-3.8


【解决方案1】:

您的用户关键字Read_Element_Locator 有问题。 好像在这一步:

${result} = Locators . Read Locator From Json ${JsonPath}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-06
    • 2018-01-23
    • 2018-02-05
    • 1970-01-01
    • 1970-01-01
    • 2018-10-15
    相关资源
    最近更新 更多