mirror of
https://github.com/appium/appium.git
synced 2026-04-29 23:09:31 -05:00
@@ -79,8 +79,8 @@ public class Find extends CommandHandler {
|
||||
.get("strategy"));
|
||||
final String contextId = (String) params.get("context");
|
||||
|
||||
if (strategy == Strategy.SEARCH_ID) {
|
||||
Logger.debug("Searching id.");
|
||||
if (strategy == Strategy.XML_VALUE) {
|
||||
Logger.debug("Searching XML values (id values).");
|
||||
final String target = params.get("selector").toString().toLowerCase();
|
||||
@SuppressWarnings("unchecked")
|
||||
final Iterator<String> iterator = apkStrings.keys();
|
||||
@@ -93,8 +93,8 @@ public class Find extends CommandHandler {
|
||||
}
|
||||
}
|
||||
return getSuccessResult(results);
|
||||
} else if (strategy == Strategy.SEARCH_VALUE) {
|
||||
Logger.debug("Searching value.");
|
||||
} else if (strategy == Strategy.XML_KEY) {
|
||||
Logger.debug("Searching XML keys (id names).");
|
||||
final String target = params.get("selector").toString().toLowerCase();
|
||||
@SuppressWarnings("unchecked")
|
||||
final Iterator<String> iterator = apkStrings.keys();
|
||||
|
||||
@@ -8,8 +8,8 @@ public enum Strategy {
|
||||
CLASS_NAME(0, "class name"), CSS_SELECTOR(1, "css selector"), ID(2, "id"), NAME(
|
||||
3, "name"), LINK_TEXT(4, "link text"), PARTIAL_LINK_TEXT(5,
|
||||
"partial link text"), TAG_NAME(6, "tag name"), XPATH(7, "xpath"), DYNAMIC(
|
||||
8, "dynamic"), SEARCH_ID(9, "search id"), RESOLVE_ID(10, "resolve id"), SEARCH_VALUE(
|
||||
11, "search value");
|
||||
8, "dynamic"), RESOLVE_ID(9, "resolve id"), XML_KEY(10, "xmlKeyContains"), XML_VALUE(
|
||||
11, "xmlValueContains");
|
||||
|
||||
public static Strategy fromString(final String text) {
|
||||
if (text != null) {
|
||||
|
||||
+14
-14
@@ -336,24 +336,24 @@ exports.find = function(req, res) {
|
||||
}
|
||||
};
|
||||
|
||||
exports.searchId = function(req, res) {
|
||||
var strategy = "search id"
|
||||
, selector = req.body;
|
||||
req.device.findElements(strategy, selector, getResponseHandler(req, res));
|
||||
};
|
||||
|
||||
exports.searchValue = function(req, res) {
|
||||
var strategy = "search value"
|
||||
, selector = req.body;
|
||||
req.device.findElements(strategy, selector, getResponseHandler(req, res));
|
||||
};
|
||||
|
||||
exports.resolveId = function(req, res) {
|
||||
var strategy = "resolve id"
|
||||
, selector = req.body;
|
||||
req.device.findElements(strategy, selector, getResponseHandler(req, res));
|
||||
};
|
||||
|
||||
exports.xmlKeyContains = function(req, res) {
|
||||
var strategy = "xmlKeyContains"
|
||||
, selector = req.body;
|
||||
req.device.findElements(strategy, selector, getResponseHandler(req, res));
|
||||
};
|
||||
|
||||
exports.xmlValueContains = function(req, res) {
|
||||
var strategy = "xmlValueContains"
|
||||
, selector = req.body;
|
||||
req.device.findElements(strategy, selector, getResponseHandler(req, res));
|
||||
};
|
||||
|
||||
exports.mobileSwipe = function(req, res) {
|
||||
req.body = _.defaults(req.body, {
|
||||
touchCount: 1
|
||||
@@ -857,8 +857,8 @@ var mobileCmdMap = {
|
||||
, 'fireEvent': exports.fireEvent
|
||||
, 'source': exports.mobileSource
|
||||
, 'find': exports.find
|
||||
, 'searchId': exports.searchId
|
||||
, 'searchValue': exports.searchValue
|
||||
, 'xmlValueContains': exports.xmlValueContains
|
||||
, 'xmlKeyContains': exports.xmlKeyContains
|
||||
, 'resolveId': exports.resolveId
|
||||
, 'waitForPageLoad': exports.waitForPageLoad
|
||||
, 'currentActivity': exports.getCurrentActivity
|
||||
|
||||
Reference in New Issue
Block a user