chrome 正受到自动化测试软件的控制

问题

web自动化运行的时候,谷歌浏览器输入框显示data,不安全,求老师们帮忙解决下吧

代码

class basePage():
def __init__(self, base_driver=None):
#base_driver是个None对象,后面需要self.driver关联不出来,给base_driver添加注解即可解决 base_driver: WebDriver if base driver is None:
chrome_options =webdriver.ChromeOptions()
# chrome_options.add_arqument("--no-sandbox") 

chrome_options.add_experimental_ option('useAutomationExtension', Fa lse)
chrome_options.add_experimental_ option('excludeSwitches',['enable- automation']) chrome_options.add_argument("--s tart-maximized") chrome_options.add_araument('dis
chrome_options.add_argument('disable-infobars')
self.driver =webdriver.chrome(chrome_options=chrome_options) 
self.driver.implicitly_wait(10)

else:
self.driver = base_driver

def _login(self):

self.driver.get("https://xxx")
# 谷歌浏览器自带的高级选项按钮
self.driver.find_element(Bv.ID."details-button").send_keys(Keys.ENTER)
# time.sleep(30)
# 谷歌浏览器自带的继续浏览XX按钮
self.driver.find_element(By.ID,"proceed-link").send_keys(Keys.ENTER)
# 输入用户登录的手机号
self.driver.find_element(By.ID, "user").send_keys("18710061002")

# 输入用户登录的密码
self.driver.find_element(By.ID,"pass_encode").send_keys("gwer1234##")
# 输入用户登录的短信验证码	数据库写死123123	
self.driver.find_element(By.ID,"phonecode").send_keys("123123")
# 登陆页面的回车
self.driver.find_element(By.ID,"phonecode").send_keys(Keys.ENTER)

这个是浏览器正常的提示信息。

截图看下

是,但是我们系统页面打不开呢

公司内网,拍照,手机端登录测试人,上传不了照片

是有弹窗弹出阻止了自动化么,还是浏览器直接被杀掉了

对对对,阻止自动化

这种的?

这个是正常的。

如果说脚本达不到自己想要的效果,需要检查一下脚本是否正常

是的,找到原因了,这个用PO模型写的,我跟之前没用PO模型写的代码运行结果对比了一下,发现是basePage里面少了一行代码。

你说的对,代码少写了一行