问题:
如果一个测试用例,用多种定位方式,如下
self.driver.find_element(By.Xpath,"//*[@text='交易']")
self.driver.find_element(By.Id,'tv')
with open(path) as f:
steps = yaml.safe_load(f)
for step in steps:
step:dict
if 'by' and 'locator' in step.keys():
element = self._driver.find_element(step['by'],step['locator'])
if 'action' in step.keys():
action=step['action']
if action == 'click':
element.click()
使用测试步骤的数据驱动后,怎么在一个测试用例里同时定位到这两个元素呢?