pycharm使用中突然不显示代码提示
调试过程:按照网上通用教程调试,并没有起作用-----过程发现文件名不符合pytest格式,修改后仍然没有提示------按照网上教程修改pycharm-preferences,执行代码报AttributeError: module ‘appium.webdriver.webdriver’ has no attribute ‘Remote’-------将from appium.WebDriver import webdriver改为from appium import webdriver------代码执行正常
总结:代码不提示可能是appium.WebDriver中覆盖范围小,想用的方法并不在其中,所以不提示,或者是pytest环境不对,修改环境后就好了?
from appium import webdriver
from selenium.webdriver.remote.mobile import Mobile
class TestToast():
def setup(self):
desire = {
‘platform’: “android”,
‘platformVersion’: “6.0”,
‘deviceName’: “127.0.0.1:7555”,
‘appPackage’: “io.appium.android.apis”,
‘appActivity’:“io.appium.android.apis.view.PopupMenu1”
}
self.driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desire)