0

I am new on robotframework automating testing, where I try to test my flutter apps, but got this error when I run the test case

    *** Settings ***
    Documentation    Suite description
    Library         AppiumLibrary

    *** Variables ***
    ${APPIUM_SERVER}=       http://127.0.0.1:4723/wd/hub
    ${ANDROID_PLAT_NAME}=   Android
    ${ANDROID_PLAT_VER}=    9.0
    ${DEVICE_NAME}=         sopniz6l65qsysyt
    ${PACKET_NAME}=         com.microfabrix.onboarding
    ${ACTIVITY_NAME}=       com.microfabrix.onboarding.MainActivity
    ${fullReset}=           false
    ${noReset}=             true

    *** Test Cases ***
    Test title
        [Tags]    DEBUG
        Provided precondition
        When action
        Then check expectations

    Login
        open application    ${APPIUM_SERVER}        platformName=${ANDROID_PLAT_NAME}        platformVersion=${ANDROID_PLAT_VER}     deviceName=${DEVICE_NAME}       automationName=Appium      appPackage=${PACKET_NAME}       appActivity=${ACTIVITY_NAME}        fullReset=${fullReset}      noReset=${noReset}
        sleep                  3
        click button           id=loginBtn
        sleep                  3
        click button           id=page1Btn
        sleep                  3

and the result is

    (venv) G:\PyCharm>robot -t Login TestCase/onboarding_test.robot
    ==============================================================================
    Onboarding Test :: Suite description
    ==============================================================================
    Login                                                                 | FAIL |
    AttributeError: 'dict' object has no attribute 'has_key'
    ------------------------------------------------------------------------------
    Onboarding Test :: Suite description                                  | FAIL |
    1 critical test, 0 passed, 1 failed
    1 test total, 0 passed, 1 failed
    ==============================================================================
    Output:  G:\PyCharm\output.xml
    Log:     G:\PyCharm\log.html
    Report:  G:\PyCharm\report.html

I am not using any has_key on my apps, also not using in on my apps code, but got this error. I use python 3.7 and appiumlibrary, already googled and found some suggestions to downgrade to python 2. but still got same error.

is it because i try to test flutter on robotframework?

this is my log enter image description here

5
  • This is already answered in stackoverflow.com/a/46677977/5967122 Commented Feb 11, 2020 at 4:37
  • its different, in my code there is no has_key Commented Feb 11, 2020 at 6:40
  • btw I use apps from this github to test on robotframework github.com/netfirms/flutter-appium-example Commented Feb 11, 2020 at 8:20
  • 2
    You do need to provide at least a sample code reproducing the issue, together with the libraries you used. Commented Feb 11, 2020 at 8:20
  • edited, maybe it will help Commented Feb 12, 2020 at 4:32

1 Answer 1

1

Turns out (for me at least, I've never used the library) this is a known issue - "Click Button keyword doesn't work on python 3" https://github.com/serhatbolsu/robotframework-appiumlibrary/issues/255.

The workaround cited in the bug is to use Click Element.

On a side note, the library's documentatuon says it officially supports Python 2 only, so expect issues like this.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.