Skip to content

Instantly share code, notes, and snippets.

@ajayk
Created September 6, 2011 16:53
Show Gist options
  • Save ajayk/1198157 to your computer and use it in GitHub Desktop.
Save ajayk/1198157 to your computer and use it in GitHub Desktop.
Index: RemoteWebElement.java
===================================================================
--- RemoteWebElement.java (revision 13749)
+++ RemoteWebElement.java (working copy)
@@ -38,7 +38,6 @@
import java.util.List;
import java.util.Map;
-
public class RemoteWebElement implements WebElement, FindsByLinkText, FindsById, FindsByName,
FindsByTagName, FindsByClassName, FindsByCssSelector, FindsByXPath, WrapsDriver, Locatable {
@@ -72,7 +71,13 @@
}
public void clear() {
- execute(DriverCommand.CLEAR_ELEMENT, ImmutableMap.of("id", id));
+ if (isEnabled()) {
+ if (!(Boolean.valueOf(getAttribute("readonly")))) {
+ execute(DriverCommand.CLEAR_ELEMENT, ImmutableMap.of("id", id));
+ }
+ }else {
+ //Should i throw a exception
+ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment