I have a fixture of connection driver to appium server
@pytest.fixture(scope='module')
def appium_driver(request):
base_desired_caps = {
"platformName": "Android",
"deviceName": "emulator-5554"
}
desired_caps = base_desired_caps.copy()
marker = request.node.get_closest_marker("desired_caps")
if marker:
desired_caps.update(marker.kwargs)
driver = None
try:
driver = webdriver.Remote("http://localhost:4723/wd/hub", desired_caps)
yield driver
except Exception as e:
print("Driver connection error:", e)
raise
finally:
if driver:
driver.quit()
and test function for auth
@pytest.mark.desired_caps(appPackage="com.olsoft.mats.dev", appActivity="com.beepul.lite.MainActivity")
def test_auth(appium_driver):
pass
But it won't work. For other test functions I don't need to relaunch the app, I need to go further in the app, that's why after auth there is no need in reconnecting driver
I tried this, connection driver response 200, but then I get 404, because I cannot locate element, cause I didn't launch the app through giving params appPackage and appActivity