Skip to content

Commit

Permalink
Merge pull request appium#1824 from bootstraponline/master
Browse files Browse the repository at this point in the history
Escape single quotes for iOS id search
  • Loading branch information
jlipps committed Jan 29, 2014
2 parents 05ce60f + 2fa6443 commit 728f6c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/devices/ios/ios-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ iOSController.findUIElementOrElements = function (strategy, selector, ctx, many,
} else if (strategy === "xpath") {
command = ["au.getElement", ext, "ByXpath('", selector, "'", ctx, ")"].join('');
} else if (strategy === "id") {
selector = selector.replace(/'/g, "\\\\'"); // must escape single quotes
command = ["var exact = au.mainApp.getFirstWithPredicateWeighted(\"name == '", selector,
"' || label == '", selector, "' || value == '", selector, "'\");"].join('');
command += ["exact && exact.status == 0 ? exact : au.mainApp.getFirstWith",
Expand Down

0 comments on commit 728f6c7

Please sign in to comment.