Skip to content
Closed
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
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ signing.secretKeyRingFile=PathToYourKeyRingFile
ossrhUsername=your-jira-id
ossrhPassword=your-jira-password

selenium.version=3.141.59
selenium.version=4.0.0-rc-3
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ public DefaultGenericMobileDriver(CommandExecutor executor, Capabilities desired
return (T) super.findElement(by, using);
}

@Override public List findElementsById(String id) {
return super.findElementsById(id);
public List findElementsById(String id) {
return super.findElements(By.id(id));
}

@Override public T findElementById(String id) {
return (T) super.findElementById(id);
public T findElementById(String id) {
return (T) super.findElement(By.id(id));
}

/**
Expand All @@ -75,7 +75,7 @@ public DefaultGenericMobileDriver(CommandExecutor executor, Capabilities desired
* @throws WebDriverException This method doesn't work against native app UI.
*/
public T findElementByLinkText(String using) throws WebDriverException {
return (T) super.findElementByLinkText(using);
return (T) super.findElement(By.linkText(using));
}

/**
Expand All @@ -84,7 +84,7 @@ public T findElementByLinkText(String using) throws WebDriverException {
* @throws WebDriverException This method doesn't work against native app UI.
*/
public List findElementsByLinkText(String using) throws WebDriverException {
return super.findElementsByLinkText(using);
return super.findElements(By.linkText(using));
}

/**
Expand All @@ -93,7 +93,7 @@ public List findElementsByLinkText(String using) throws WebDriverException {
* @throws WebDriverException This method doesn't work against native app UI.
*/
public T findElementByPartialLinkText(String using) throws WebDriverException {
return (T) super.findElementByPartialLinkText(using);
return (T) super.findElement(By.linkText(using));
}

/**
Expand All @@ -102,31 +102,31 @@ public T findElementByPartialLinkText(String using) throws WebDriverException {
* @throws WebDriverException This method doesn't work against native app UI.
*/
public List findElementsByPartialLinkText(String using) throws WebDriverException {
return super.findElementsByPartialLinkText(using);
return super.findElements(By.linkText(using));
}

public T findElementByTagName(String using) {
return (T) super.findElementByTagName(using);
return (T) super.findElement(By.tagName(using));
}

public List findElementsByTagName(String using) {
return super.findElementsByTagName(using);
return super.findElements(By.tagName(using));
}

public T findElementByName(String using) {
return (T) super.findElementByName(using);
return (T) super.findElement(By.name(using));
}

public List findElementsByName(String using) {
return super.findElementsByName(using);
return super.findElements(By.name(using));
}

public T findElementByClassName(String using) {
return (T) super.findElementByClassName(using);
return (T) super.findElement(By.className(using));
}

public List findElementsByClassName(String using) {
return super.findElementsByClassName(using);
return super.findElements(By.className(using));
}

/**
Expand All @@ -135,7 +135,7 @@ public List findElementsByClassName(String using) {
* @throws WebDriverException This method doesn't work against native app UI.
*/
public T findElementByCssSelector(String using) throws WebDriverException {
return (T) super.findElementByCssSelector(using);
return (T) super.findElement(By.cssSelector(using));
}

/**
Expand All @@ -144,15 +144,15 @@ public T findElementByCssSelector(String using) throws WebDriverException {
* @throws WebDriverException This method doesn't work against native app UI.
*/
public List findElementsByCssSelector(String using) throws WebDriverException {
return super.findElementsByCssSelector(using);
return super.findElements(By.cssSelector(using));
}

public T findElementByXPath(String using) {
return (T) super.findElementByXPath(using);
return (T) super.findElement(By.xpath(using));
}

public List findElementsByXPath(String using) {
return super.findElementsByXPath(using);
return super.findElements(By.xpath(using));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ abstract class DefaultGenericMobileElement<T extends WebElement> extends RemoteW
return (T) super.findElement(by, using);
}

@Override public List findElementsById(String id) {
return super.findElementsById(id);
public List findElementsById(String id) {
return super.findElements(By.id(id));
}

@Override public T findElementById(String id) {
return (T) super.findElementById(id);
public T findElementById(String id) {
return (T) super.findElement(By.id(id));
}

/**
Expand All @@ -79,7 +79,7 @@ abstract class DefaultGenericMobileElement<T extends WebElement> extends RemoteW
* @throws WebDriverException This method doesn't work against native app UI.
*/
public T findElementByLinkText(String using) throws WebDriverException {
return (T) super.findElementByLinkText(using);
return (T) super.findElement(By.linkText(using));
}

/**
Expand All @@ -88,7 +88,7 @@ public T findElementByLinkText(String using) throws WebDriverException {
* @throws WebDriverException This method doesn't work against native app UI.
*/
public List findElementsByLinkText(String using) throws WebDriverException {
return super.findElementsByLinkText(using);
return super.findElements(By.linkText(using));
}

/**
Expand All @@ -97,7 +97,7 @@ public List findElementsByLinkText(String using) throws WebDriverException {
* @throws WebDriverException This method doesn't work against native app UI.
*/
public T findElementByPartialLinkText(String using) throws WebDriverException {
return (T) super.findElementByPartialLinkText(using);
return (T) super.findElement(By.linkText(using));
}

/**
Expand All @@ -106,31 +106,31 @@ public T findElementByPartialLinkText(String using) throws WebDriverException {
* @throws WebDriverException This method doesn't work against native app UI.
*/
public List findElementsByPartialLinkText(String using) throws WebDriverException {
return super.findElementsByPartialLinkText(using);
return super.findElements(By.linkText(using));
}

public T findElementByTagName(String using) {
return (T) super.findElementByTagName(using);
return (T) super.findElement(By.tagName(using));
}

public List findElementsByTagName(String using) {
return super.findElementsByTagName(using);
return super.findElements(By.tagName(using));
}

public T findElementByName(String using) {
return (T) super.findElementByName(using);
return (T) super.findElement(By.name(using));
}

public List findElementsByName(String using) {
return super.findElementsByName(using);
return super.findElements(By.name(using));
}

public T findElementByClassName(String using) {
return (T) super.findElementByClassName(using);
return (T) super.findElement(By.className(using));
}

public List findElementsByClassName(String using) {
return super.findElementsByClassName(using);
return super.findElements(By.className(using));
}

/**
Expand All @@ -139,7 +139,7 @@ public List findElementsByClassName(String using) {
* @throws WebDriverException This method doesn't work against native app UI.
*/
public T findElementByCssSelector(String using) throws WebDriverException {
return (T) super.findElementByCssSelector(using);
return (T) super.findElement(By.cssSelector(using));
}

/**
Expand All @@ -148,15 +148,15 @@ public T findElementByCssSelector(String using) throws WebDriverException {
* @throws WebDriverException This method doesn't work against native app UI.
*/
public List findElementsByCssSelector(String using) throws WebDriverException {
return super.findElementsByCssSelector(using);
return super.findElements(By.cssSelector(using));
}

public T findElementByXPath(String using) {
return (T) super.findElementByXPath(using);
return (T) super.findElement(By.xpath(using));
}

public List findElementsByXPath(String using) {
return super.findElementsByXPath(using);
return super.findElements(By.xpath(using));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import lombok.Data;
import lombok.experimental.Accessors;
import okhttp3.Interceptor;

import static com.google.common.base.Preconditions.checkArgument;
import static org.apache.commons.lang3.StringUtils.isBlank;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.remote.RemoteWebElement;
import org.openqa.selenium.remote.internal.JsonToWebElementConverter;
import org.openqa.selenium.remote.JsonToWebElementConverter;

import java.lang.reflect.Constructor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
import org.openqa.selenium.remote.ProtocolHandshake;
import org.openqa.selenium.remote.Response;
import org.openqa.selenium.remote.ResponseCodec;
import org.openqa.selenium.remote.codec.w3c.W3CHttpCommandCodec;
import org.openqa.selenium.remote.http.HttpClient;
import org.openqa.selenium.remote.http.HttpRequest;
import org.openqa.selenium.remote.http.HttpResponse;
import org.openqa.selenium.remote.http.W3CHttpCommandCodec;
import org.openqa.selenium.remote.service.DriverService;

import java.io.BufferedInputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import org.openqa.selenium.interactions.KeyInput;
import org.openqa.selenium.interactions.Sequence;
import org.openqa.selenium.remote.http.W3CHttpCommandCodec;
import org.openqa.selenium.remote.codec.w3c.W3CHttpCommandCodec;

import java.util.Collection;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.openqa.selenium.Capabilities;
import org.openqa.selenium.MutableCapabilities;
import org.openqa.selenium.Platform;
import org.openqa.selenium.ScreenOrientation;
import org.openqa.selenium.remote.CapabilityType;

Expand Down Expand Up @@ -58,8 +59,8 @@ public T setPlatformName(String platform) {
* @return String representing the kind of mobile device or emulator to use.
* @see org.openqa.selenium.remote.CapabilityType#PLATFORM_NAME
*/
public String getPlatformName() {
return (String) getCapability(CapabilityType.PLATFORM_NAME);
public Platform getPlatformName() {
return (Platform) getCapability(CapabilityType.PLATFORM_NAME);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public final class AppiumDriverLocalService extends DriverService {
AppiumDriverLocalService(String ipAddress, File nodeJSExec, int nodeJSPort,
ImmutableList<String> nodeJSArgs, ImmutableMap<String, String> nodeJSEnvironment,
long startupTimeout, TimeUnit timeUnit) throws IOException {
super(nodeJSExec, nodeJSPort, nodeJSArgs, nodeJSEnvironment);
super(nodeJSExec, nodeJSPort, Duration.ofSeconds(startupTimeout), nodeJSArgs, nodeJSEnvironment);
this.nodeJSExec = nodeJSExec;
this.nodeJSArgs = nodeJSArgs;
this.nodeJSEnvironment = nodeJSEnvironment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -474,11 +475,12 @@ public AppiumServiceBuilder withLogFile(File logFile) {

@Override
protected AppiumDriverLocalService createDriverService(File nodeJSExecutable, int nodeJSPort,
ImmutableList<String> nodeArguments,
ImmutableMap<String, String> nodeEnvironment) {
Duration timeout,
List<String> nodeArguments,
Map<String, String> nodeEnvironment) {
try {
return new AppiumDriverLocalService(ipAddress, nodeJSExecutable, nodeJSPort,
nodeArguments, nodeEnvironment, startupTimeout, timeUnit);
ImmutableList.copyOf(nodeArguments), (ImmutableMap<String, String>) nodeEnvironment, startupTimeout, timeUnit);
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import org.openqa.selenium.Point;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.internal.HasIdentity;
import org.openqa.selenium.remote.RemoteWebElement;

import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -84,9 +84,9 @@ public ElementOption withCoordinates(int xOffset, int yOffset) {
public ElementOption withElement(WebElement element) {
checkNotNull(element);
checkArgument(true, "Element should be an instance of the class which "
+ "implements org.openqa.selenium.internal.HasIdentity",
element instanceof HasIdentity);
elementId = ((HasIdentity) element).getId();
+ "implements org.openqa.selenium.remote.RemoteWebElement",
element instanceof RemoteWebElement);
elementId = ((RemoteWebElement) element).getId();
return this;
}

Expand Down