Python selenium 2层对话框怎么定位确定按钮,xpath获取保存元素不对。
class UI_0002:
name = 'MPS_CU_商品管理-编辑表单 UI_0002'
def teststeps(self):
wd = GSTORE['wd']
STEP(1, '点击商品管理菜单')
wd.find_element_by_xpath('/html/body/div/div/div/div/ul/li/a/div/div/label').click()
sleep(1)
STEP(2, '点击表单管理按钮')
wd.find_element_by_xpath('/html/body/div/div/section/main/div/div/div/div/button/span').click()
sleep(1)
STEP(3, '点击编辑按钮')
wd.find_element_by_xpath(
'/html/body/div/div/section/main/div/div/div/div/div/div/div/div/div/div/div/table/tbody/tr/td/div/div/button/span').click()
sleep(1)
STEP(4, '点击保存按钮')
wd.find_element_by_xpath('/html/body/div/div/div/div/button').click()
sleep(1)
SELENIUM_LOG_SCREEN(wd, width='70%')
再点开button那行的展开按钮,看看有没有id或name 这种属于模态框
页:
[1]