self = <test_my.page.widget.Widget object at 0x04233658>
path = ‘…/page/erctext.yaml’
def spets(self,path):
with open(path,encoding="utf-8") as f:
stepss: list[dict]=yaml.safe_load(f)
#element:WebElement=None
for spet in stepss:
if 'by' in spet.keys():
element=self.find(spet['by'],spet['locator'])
if 'action' in spet.keys():
action=spet['action']
if action == "click":
element.click()
elif action == "text":
element.text()
E TypeError: ‘str’ object is not callable