File tree 2 files changed +11
-2
lines changed
src/org/openqa/selenium/htmlunit
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 27
27
28
28
import net .sourceforge .htmlunit .corejs .javascript .Undefined ;
29
29
30
+ import org .apache .commons .lang3 .StringUtils ;
30
31
import org .openqa .selenium .By ;
31
32
import org .openqa .selenium .Dimension ;
32
33
import org .openqa .selenium .ElementNotVisibleException ;
@@ -454,6 +455,14 @@ public String getAttribute(String name) {
454
455
return "" ;
455
456
}
456
457
458
+ final Object slotVal = element .getScriptObject ().get (name );
459
+ if (slotVal instanceof String ) {
460
+ String strVal = (String ) slotVal ;
461
+ if (StringUtils .isNotEmpty (strVal )) {
462
+ return strVal ;
463
+ }
464
+ }
465
+
457
466
return null ;
458
467
}
459
468
Original file line number Diff line number Diff line change 20
20
import org .junit .Test ;
21
21
import org .openqa .selenium .testing .Ignore ;
22
22
import org .openqa .selenium .testing .JUnit4TestBase ;
23
+ import org .openqa .selenium .testing .JavascriptEnabled ;
23
24
24
25
import java .util .List ;
25
26
35
36
import static org .junit .Assert .assertTrue ;
36
37
import static org .junit .Assert .fail ;
37
38
import static org .openqa .selenium .testing .Ignore .Driver .ANDROID ;
38
- import static org .openqa .selenium .testing .Ignore .Driver .HTMLUNIT ;
39
39
import static org .openqa .selenium .testing .Ignore .Driver .IE ;
40
40
import static org .openqa .selenium .testing .Ignore .Driver .IPHONE ;
41
41
import static org .openqa .selenium .testing .Ignore .Driver .MARIONETTE ;
@@ -398,7 +398,7 @@ public void testMultipleAttributeShouldBeTrueWhenSelectHasMultipleWithValueAsSom
398
398
assertEquals ("true" , element .getAttribute ("multiple" ));
399
399
}
400
400
401
- @ Ignore ({ HTMLUNIT })
401
+ @ JavascriptEnabled
402
402
@ Test
403
403
public void testGetAttributeOfUserDefinedProperty () {
404
404
driver .get (pages .userDefinedProperty );
You can’t perform that action at this time.
0 commit comments