mirror of
https://github.com/appium/appium.git
synced 2026-05-03 17:00:32 -05:00
Fix iOS callback problem after finding an element by a wrong id
This commit is contained in:
@@ -88,7 +88,7 @@ iOSController.findUIElementOrElements = function (strategy, selector, ctx, many,
|
||||
try {
|
||||
selector = this.getSelectorForStrategy(strategy, selector);
|
||||
} catch (e) {
|
||||
cb(null, {
|
||||
return cb(null, {
|
||||
status: status.codes.UnknownError.code
|
||||
, value: e
|
||||
});
|
||||
@@ -230,7 +230,12 @@ iOSController.getSelectorForStrategy = function (strategy, selector) {
|
||||
var newSelector = selector;
|
||||
if (strategy === "id") {
|
||||
var strings = this.localizableStrings;
|
||||
if (strings && strings.length >= 1) newSelector = strings[0][selector];
|
||||
if (strings && strings.length >= 1) {
|
||||
newSelector = strings[0][selector];
|
||||
if (!newSelector) {
|
||||
throw new TypeError("Id selector not found in Localizable.strings.");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (strategy === 'class name') {
|
||||
if (selector.indexOf('UIA') !== 0) {
|
||||
|
||||
Reference in New Issue
Block a user