Код Ниже приведен пример кода для тестирования калькулятора и Android-программы, используемой robotframework AppiumLibrary
*** Settings ***
Library AppiumLibrary run_on_failure=Log Source
#Library Selenium2Library
#Library OperatingSystem
#Setup Open Calculator
#Teardown Close Application
*** Variables ***
${DEV.APPIUM_SERVER} = https://127.0.0.1/wd/hub
${DEV.PLATFORM_VERSION} = 7.0.1
${DEV.PLATFORM_NAME} = Android
${DEV.DEVICE_NAME} = device1
${DEV.PACKAGE_NAME} = com.google.android.calculator
${DEV.ACTIVITY_NAME} = com.android.calculator2.Calculator
#Elements locators for various
${EQUALS_SIGN} = xpath=//*[contains(@text,'=')]
${DISPLAYED_RESULT} = xpath=//*[contains(@resource-id,'id/result')]
${td_Digit1} = 5
${td_Digit2} = 2
${td_Expcted_Addition_Result} = 7
${td_Expected_Subtraction_Result} = 3
*** Keywords ***
Open Calculator App
Open Application ${DEV.APPIUM_SERVER} platformName=${DEV.PLATFORM_NAME} platformVersion=${DEV.PLATFORM_VERSION} deviceName=${DEV.DEVICE_NAME} appPackage=${DEV.PACKAGE_NAME} appActivity=${DEV.ACTIVITY_NAME}
Enter Digits And Operator
[Arguments] ${digit1} ${digit2} ${operator}
Click Element xpath=//*[contains(@test,'${digit1}')]
Click Element xpath=//*[contains(@text,'${operator}')]
Click Element xpath=//*[contains(@text,'${digit2}')]
View Result
Click Elemet ${EQUALS_SIGN}
Verify Result
[Arguments] ${expected_result}
${displayed_result} = Get Element Attribute ${DISPLAYED_RESULT} text
Should Be Equal ${displayed_result} ${expcted_result}
*** Test Cases ***
Test Case 1: Addition
Open Calculator App
Enter Digits And Operator ${td_Digit1} ${td_Digit2} +
View Result
Verify Result
Над кодом после запуска ниже ошибки:
ТестСлучай 1: Добавление URLError: ошибка urlopen неизвестен тип URL: = http
Сервер Appium уже запущен в системе.Пожалуйста, помогите мне найти ошибку