fixed error caused by editing twice

This commit is contained in:
Alex Kogon
2015-09-10 16:09:16 +02:00
parent f016d77eab
commit d6bd79d578

View File

@@ -146,13 +146,14 @@ public class XpathManager implements Runnable{
if (!parentClassStr.isEmpty())
{
if (!txtStr.isEmpty()&&useFullTextMatching) {
if (txtStr.length() > maxTextLength) {// if the text is too long only test the first maxTextLength characters
txtStr = WindowsEnumeratedXml.escapeXmlAttributeValue(txtStr.substring(0, maxTextLength));
txtStr = " and starts-with(@text,'" + txtStr + "')";
String copyOfTxtStr = txtStr;
if (copyOfTxtStr.length() > maxTextLength) {// if the text is too long only test the first maxTextLength characters
copyOfTxtStr = WindowsEnumeratedXml.escapeXmlAttributeValue(copyOfTxtStr.substring(0, maxTextLength));
copyOfTxtStr = " and starts-with(@text,'" + copyOfTxtStr + "')";
}
else
txtStr = " and @text='" + txtStr + "'";
builtXpath = "//win[@class='" + parentClassStr + "'" + parentTxtStr + "]/win[@class='" + classStr + "'" + txtStr + "]";
copyOfTxtStr = " and @text='" + copyOfTxtStr + "'";
builtXpath = "//win[@class='" + parentClassStr + "'" + parentTxtStr + "]/win[@class='" + classStr + "'" + copyOfTxtStr + "]";
}
else
{