Skip to content

Commit

Permalink
No logical changes: moving method invocation in JsonToWebElementConve…
Browse files Browse the repository at this point in the history
…rter
  • Loading branch information
shs96c committed Apr 3, 2017
1 parent 48a1c7b commit 9a7082b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,9 @@ protected WebElement findElement(String by, String using) {

protected void setFoundBy(SearchContext context, WebElement element, String by, String using) {
if (element instanceof RemoteWebElement) {
((RemoteWebElement) element).setFoundBy(context, by, using);
RemoteWebElement remoteElement = (RemoteWebElement) element;
remoteElement.setFoundBy(context, by, using);
remoteElement.setFileDetector(getFileDetector());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,10 @@ public Object apply(Object result) {
if (resultAsMap.containsKey(Dialect.OSS.getEncodedElementKey())) {
RemoteWebElement element = newRemoteWebElement();
element.setId(String.valueOf(resultAsMap.get(Dialect.OSS.getEncodedElementKey())));
element.setFileDetector(driver.getFileDetector());
return element;
} else if (resultAsMap.containsKey(Dialect.W3C.getEncodedElementKey())) {
RemoteWebElement element = newRemoteWebElement();
element.setId(String.valueOf(resultAsMap.get(Dialect.W3C.getEncodedElementKey())));
element.setFileDetector(driver.getFileDetector());
return element;
} else {
return Maps.transformValues(resultAsMap, this);
Expand All @@ -75,9 +73,10 @@ public Object apply(Object result) {
return result;
}

protected RemoteWebElement newRemoteWebElement() {
private RemoteWebElement newRemoteWebElement() {
RemoteWebElement toReturn = new RemoteWebElement();
toReturn.setParent(driver);
toReturn.setFileDetector(driver.getFileDetector());
return toReturn;
}
}

0 comments on commit 9a7082b

Please sign in to comment.