我有定位器.py在
class MainPageLocatars(object):
# Login function locators
LOGFILELOCATOR = (By.XPATH, '//a[contains(@href, "%s")]/./../../td[7]')
我打电话给这个定位器如下:
^{pr2}$这是正确的方法吗?在
这是我得到的错误:
beforeDate = self.driver.find_element_by_xpath((AutoLoaderLocatars.LOGFILELOCATOR) % logFile).text
TypeError: unsupported operand type(s) for %: 'tuple' and 'str'
MainPageLocatars.LOGFILELOCATOR
是一个元组:实际上它包含两个元素。元组上没有定义%
运算符。在您应该解绑并处理结果:
相关问题 更多 >
编程相关推荐