Hello everyone i am stuck with the appium - python - cucumber. Can please someone help?
Here is full error:
Initializing Appium driver with desired capabilities…
Error initializing the driver: ‘NoneType’ object has no attribute ‘to_capabilities’
HOOK-ERROR in before_all: AttributeError: ‘NoneType’ object has no attribute ‘to_capabilities’
HOOK-ERROR in after_all: AttributeError: ‘Context’ object has no attribute ‘driver’
my env file
from appium import webdriver
from behave import use_fixture
def before_all(context):
try:
desired_caps = {
'platformName': 'Android',
'deviceName': 'emulator-5554',
'platformVersion': '14',
'app': 'C:\\Users\\jakub\\Downloads\\Appium\\AppiumProject\\amaze-file-manager-3-10.apk',
'automationName': 'UiAutomator2'
}
print("Initializing Appium driver with desired capabilities...")
context.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
print("Driver initialized:", context.driver)
except Exception as e:
print(f"Error initializing the driver: {e}")
raise
def after_all(context):
"""
Teardown that runs after all tests.
Here you might close the connection to the Appium server.
"""
context.driver.quit()
def before_feature(context, feature):
"""
This runs before each feature file is exercised.
"""
# Setup specific to a feature can be added here.
def after_feature(context, feature):
"""
This runs after each feature file is exercised.
"""
# Teardown specific to a feature can be added here.
def before_scenario(context, scenario):
"""
This runs before each scenario is run.
"""
# Setup specific to a scenario can be added here.
def after_scenario(context, scenario):
"""
This runs after each scenario is run.
"""
# Teardown specific to a scenario can be added here.