Fix the bug with corrupted search context value "ctx" while during xpath search

avoiding bad syntax in case of context is empty string
This commit is contained in:
Vitalii Grygoruk
2014-05-12 16:56:34 +02:00
parent a7a555fc29
commit 6294bcbcb2

View File

@@ -40,6 +40,7 @@ iOSController.createGetElementCommand = function (strategy, selector, ctx,
many) {
var ext = many ? 's' : '';
var command = "";
ctx = !ctx ? ctx : ", '" + ctx + "'" ;
switch (strategy) {
case "name":
helpers.logDeprecationWarning("Locator Strategy", '"name"',
@@ -82,7 +83,6 @@ iOSController.findUIElementOrElements = function (strategy, selector, ctx, many,
ctx = '';
} else if (typeof ctx === "string") {
ctx = escapeSpecialChars(ctx, "'");
ctx = ", '" + ctx + "'";
}
try {