hi。老师
我在pycharm里面可以执行该脚本,在pycharm里面terminal可以执行,但唯独在cmd里面没法执行。
这个是代码:
import sys
sys.path.append('D:/Pycharm/zhongji')
import time
from appium import webdriver
import unittest
class MyTestCase(unittest.TestCase):
def setUp(self):
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '6.0'
desired_caps['deviceName'] = '192.168.244.101:5555'
desired_caps['appPackage'] = 'com.mook.mook'
desired_caps['appActivity'] = '.LoginActivity'
desired_caps["unicodeKeyboard"] = "True"
desired_caps["resetKeyboard"] = "True"
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
def testloginwrong(self):
time.sleep(4)
self.driver.find_element_by_id("email").send_keys("test")
self.driver.find_element_by_id("password").send_keys("test")
self.driver.find_element_by_id("email_sign_in_button").click()
try:
if self.driver.find_element_by_id("email_sign_in_button").is_displayed():
exist=True
except Exception, e:
exist = False
self.assertEqual(False, exist)
def tearDown(self):
self.driver.quit()
if __name__ == '__main__':
unittest.main()