import os,pytest,sys,random,string
from os.path import abspath, dirname
from time import sleep
base_path = dirname(dirname(abspath(file)))
sys.path.insert(0, base_path)
from config import RunConfig
from util.read_data import ReadData
from common.common_module import CommonKey
from page.element_page import ElementPage
from poium import PageWait
from selenium.webdriver.common.action_chains import ActionChains
from selenium import webdriver
import os,pytest,sys,random,string from os.path import abspath, dirname from time import sleep base_path = dirname(dirname(abspath(file))) sys.path.insert(0, base_path) from config import RunConfig from util.read_data import ReadData from common.common_module import CommonKey from page.element_page import ElementPage from poium import PageWait from selenium.webdriver.common.action_chains import ActionChains from selenium import webdriver
def test_add_object_succ(browser,base_url): ''' 删除对象 ''' dr=CommonKey().Plan_creat_Information_system_check(browser,base_url) #登录返回dr dr.add_object_button.click() dr.object_type.click() dr.object_server.click() dr.object_IP.send_keys('192.168.30.80') dr.database_or_system.click() dr.system_win.click() sleep(0.5) dr.button_save.click() sleep(0.5) dr.button_quit.click() right_win=dr.right_windows ActionChains(dr).move_to_element(right_win).context_click() dr.del_object.click() dr.determine_button2.click() PageWait(dr.Tips) sleep(0.5) assert dr.Tips.text=='操作成功!'
想通过以上代码实现右键点击,导入了 ActionChains,在执行过程中出现下面报错
网上对于这方面资料不多,没找到这方面的资料,自己代码功底也不够深
期待您的解答,非常感谢