Fixed xpath generation

This commit is contained in:
Maxim Stewart 2020-04-11 14:48:39 -05:00
parent 3b0771d2b4
commit ff349deb9e
1 changed files with 2 additions and 7 deletions

View File

@ -52,15 +52,10 @@ class ControlerMixin:
flags = ["id", "class", "type", "value"]
for key in keys:
if key in flags:
attribLst.append("@" + data[key] + "='" + data[key] + "'")
attribLst.append("@" + key + "='" + data[key] + "'")
queryCount += 1
xpathStr += ( " and ".join(attribLst) if len(attribLst) > 1 else attribLst[0] ) + "]"
if len(attribLst) > 1:
xpathStr += " and ".join(attribLst)
else:
xpathStr += attribLst[0]
xpathStr += "]"
self.logger.debug("Generated XPath: " + xpathStr)
return xpathStr