1

No keyword with name error using python appium with Robot Framework.

I am new to this appium Library and started learning the integration with Robot Framework with Python appium Library. Really Appreciate your response .

AndriodLibrary.py

import appium
from AppiumLibrary import AppiumLibrary

class Android(AppiumLibrary):

    def __init__(self):
        """
        Initializing all the Android definitions
        """
        pass

    def get_driver_instance(self):
        return self._current_application()

    @keyword(name='Login to BGApp')
    def login_to_BGApp(self, email, pswd):
        try:
            appiumlib = BuiltIn().get_library_instance('AppiumLibrary')
            driver = appiumlib._current_application()
            driver.implicitly_wait (20)
            login_button = driver.find_element_by_id(BGAppLogin).click()
            driver.implicitly_wait (5)
            # User credentials:
            userid = driver.find_element_by_id (BG_Login_Email).send_keys (email)
            password = driver.find_element_by_id (BG_Login_Pswd).send_keys (pswd)


ROBOT SCRIPT:

Library            AppiumLibrary
Library            ../lib/Android/AndroidLibrary.py
Suite Setup         configure_setup
Suite Teardown      Suite_Cleanup


*** Test Cases ***
TC_1 : Login to Android Device
    [Tags]             Login
    [Documentation]    Login to BGApp using user credentials

*** Keywords ***
configure_setup
    Log to Console      Initialize Setup
    Open Application On Android
    Login to BGApp      ${AppLogin2.Email}  ${AppLogin2.Pswd}
Open Application On Android
     Open Application   ${REMOTE_URL}    ${PLATFORM_NAME}    ${PLATFORM_VERSION}    ${DEVICE_NAME}    ${APP}

OUTPUT

==============================================================================
AndroidLogin
==============================================================================
Initialize Setup
120
TC_1 : Login to Android Device :: Login to BGApp using user credentials | FAIL |
Parent suite setup failed:
No keyword with name 'Login to BGApp' found.
------------------------------------------------------------------------------
Cleaning Suite_Cleanup
AndroidLogin                                                          | FAIL |
Suite setup failed:
No keyword with name 'Login to BGApp' found.

1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================

Already referred. Robot Framework - passing Appium driver to python script

After the changes, still getting same error. If any details missed please let me know. Will share the details. Thanks in Advance.

0 Answers0