Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions src/main/java/io/appium/java_client/AppiumBy.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,6 @@ public static By iOSNsPredicateString(final String iOSNsPredicateString) {
return new ByIosNsPredicate(iOSNsPredicateString);
}

/**
* The Windows UIAutomation selector.
* @param windowsAutomation The element name in the Windows UIAutomation selector
* @return an instance of {@link AppiumBy.ByWindowsAutomation}
*/
public static By windowsAutomation(final String windowsAutomation) {
return new ByWindowsAutomation(windowsAutomation);
}

public static class ByAccessibilityId extends AppiumBy implements Serializable {

public ByAccessibilityId(String accessibilityId) {
Expand Down Expand Up @@ -242,13 +233,6 @@ protected ByIosNsPredicate(String locatorString) {
super("-ios predicate string", locatorString, "iOSNsPredicate");
}
}

public static class ByWindowsAutomation extends AppiumBy implements Serializable {

protected ByWindowsAutomation(String locatorString) {
super("-windows uiautomation", locatorString, "windowsAutomation");
}
}
}


23 changes: 20 additions & 3 deletions src/main/java/io/appium/java_client/MobileBy.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package io.appium.java_client;

import java.io.Serializable;

import org.openqa.selenium.By;

/**
Expand Down Expand Up @@ -107,6 +109,17 @@ public static By iOSNsPredicateString(final String iOSNsPredicateString) {
return new ByIosNsPredicate(iOSNsPredicateString);
}

/**
* The Windows UIAutomation selector.
* @deprecated Not supported on the server side.
* @param windowsAutomation The element name in the Windows UIAutomation selector
* @return an instance of {@link MobileBy.ByWindowsAutomation}
*/
@Deprecated
public static By windowsAutomation(final String windowsAutomation) {
return new ByWindowsAutomation(windowsAutomation);
}

/**
* This locator strategy is available in Espresso Driver mode.
* @deprecated Use {@link AppiumBy#androidViewTag(String)} instead.
Expand Down Expand Up @@ -261,13 +274,17 @@ protected ByIosNsPredicate(String locatorString) {

/**
* The Windows UIAutomation selector.
* @deprecated Use {@link AppiumBy.ByWindowsAutomation} instead.
* @deprecated Not supported on the server side.
*/
@Deprecated
public static class ByWindowsAutomation extends AppiumBy.ByWindowsAutomation {
public static class ByWindowsAutomation extends MobileBy implements Serializable {

protected ByWindowsAutomation(String locatorString) {
super(locatorString);
super("-windows uiautomation", locatorString, "windowsAutomation");
}

@Override public String toString() {
return "By.windowsAutomation: " + getRemoteParameters().value();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@

package io.appium.java_client.pagefactory.bys.builder;

import io.appium.java_client.AppiumBy;
import io.appium.java_client.pagefactory.AndroidBy;
import io.appium.java_client.pagefactory.AndroidFindBy;

import org.openqa.selenium.By;

import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

import org.openqa.selenium.By;

import io.appium.java_client.AppiumBy;
import io.appium.java_client.MobileBy;
import io.appium.java_client.pagefactory.AndroidBy;
import io.appium.java_client.pagefactory.AndroidFindBy;

enum Strategies {
BYUIAUTOMATOR("uiAutomator") {
@Override By getBy(Annotation annotation) {
Expand Down Expand Up @@ -84,10 +85,14 @@ enum Strategies {
.partialLinkText(getValue(annotation, this));
}
},
/**
* The Windows UIAutomation strategy.
* @deprecated Not supported on the server side.
*/
@Deprecated
BYWINDOWSAUTOMATION("windowsAutomation") {
@Override By getBy(Annotation annotation) {
return AppiumBy
.windowsAutomation(getValue(annotation, this));
return MobileBy.windowsAutomation(getValue(annotation, this));
}
},
BY_CLASS_CHAIN("iOSClassChain") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.appium.java_client.pagefactory_tests.widget.tests.windows;

import static io.appium.java_client.AppiumBy.windowsAutomation;
import static io.appium.java_client.MobileBy.windowsAutomation;
import static io.appium.java_client.pagefactory_tests.widget.tests.windows.AnnotatedWindowsWidget.WINDOWS_ROOT_WIDGET_LOCATOR;
import static io.appium.java_client.pagefactory_tests.widget.tests.windows.DefaultWindowsWidget.WINDOWS_SUB_WIDGET_LOCATOR;
import static io.appium.java_client.pagefactory_tests.widget.tests.windows.WindowsApp.WINDOWS_DEFAULT_WIDGET_LOCATOR;
Expand Down