Java 类org.openqa.selenium.remote.server.KnownElements 实例源码
项目:grid-refactor-remote-server
文件:ElementEquality.java
@Override
public Boolean call() throws Exception {
WebElement one = getElement();
WebElement two = getKnownElements().get(otherId);
// Unwrap the elements, if necessary
if (one instanceof WrapsElement) {
one = ((WrapsElement) one).getWrappedElement();
}
if (two instanceof KnownElements.ProxiedElement) {
two = ((KnownElements.ProxiedElement) two).getWrappedElement();
}
return one.equals(two);
}
项目:grid-refactor-remote-server
文件:ArgumentConverter.java
public Object apply(Object arg) {
if (arg instanceof Map) {
@SuppressWarnings("unchecked")
Map<String, Object> paramAsMap = (Map<String, Object>) arg;
if (paramAsMap.containsKey("ELEMENT")) {
KnownElements.ProxiedElement element = (KnownElements.ProxiedElement) knownElements
.get((String) paramAsMap.get("ELEMENT"));
return element.getWrappedElement();
}
Map<String, Object> converted = Maps.newHashMapWithExpectedSize(paramAsMap.size());
for (Map.Entry<String, Object> entry : paramAsMap.entrySet()) {
converted.put(entry.getKey(), apply(entry.getValue()));
}
return converted;
}
if (arg instanceof List<?>) {
return Lists.newArrayList(Iterables.transform((List<?>) arg, this));
}
return arg;
}
项目:grid-refactor-remote-server
文件:ResultConverter.java
public ResultConverter(KnownElements knownElements) {
this.knownElements = knownElements;
}
项目:grid-refactor-remote-server
文件:ArgumentConverter.java
public ArgumentConverter(KnownElements knownElements) {
this.knownElements = knownElements;
}
项目:grid-refactor-remote-server
文件:WebDriverHandler.java
protected KnownElements getKnownElements() {
return getSession().getKnownElements();
}