Hi
I’m trying to use the python code which is generated from Appium Studio to run a test. And I found that “Launch(app)” in Python Code “startActivity(app)” cannot work in my environment.
And there’s an AttributeError: " ‘Webdriver’ object has no attribute ‘startActivity’ " shows in my IDE.
Is there an another appium library I have to import? Or Is there any solution that I can use the ‘Launch(app)’ in python code environment?
below pictures shows the AS script , the python code, the python code error:
Appium Studio Command:
Python Code:
import unittest
import time
from appium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
class Untitled(unittest.TestCase):
reportDirectory = 'reports'
reportFormat = 'xml'
dc = {}
testName = 'Untitled'
driver = None
def setUp(self):
self.dc['reportDirectory'] = self.reportDirectory
self.dc['reportFormat'] = self.reportFormat
self.dc['testName'] = self.testName
self.dc['udid'] = 'LC5CJB806616'
self.dc['platformName'] = 'android'
self.driver = webdriver.Remote('http://localhost:4725/wd/hub',self.dc)
def testUntitled(self):
self.driver.startActivity("com.experitest.ExperiBank", ".LoginActivity")
def tearDown(self):
self.driver.quit()
if __name__ == '__main__':
unittest.main()
Python Code Error: