@@ -555,10 +555,13 @@ WebDriverJsView.prototype.setFoundElementId = function(id) {
555
555
var element = document . getElementById ( 'foundElement' ) ;
556
556
if ( typeof id . ELEMENT === 'string' ) {
557
557
element . innerHTML = 'Found element ' + id . ELEMENT ;
558
+ element . style . visibility = 'visible' ;
559
+ document . getElementById ( 'elementActions' ) . style . visibility = 'visible' ;
558
560
} else {
559
- element . innerHTML = id . ELEMENT . message ;
561
+ element . style . visibility = 'hidden' ;
562
+ this . setError ( id . ELEMENT . message ) ;
563
+ document . getElementById ( 'elementActions' ) . style . visibility = 'hidden' ;
560
564
}
561
- element . style . visibility = 'visible' ;
562
565
}
563
566
564
567
WebDriverJsView . prototype . setError = function ( message ) {
@@ -669,6 +672,60 @@ WebDriverJsController.prototype.onFindElement = function() {
669
672
} ) ;
670
673
} ;
671
674
675
+ WebDriverJsController . prototype . onElementClick = function ( ) {
676
+ this . element . click ( ) ;
677
+ } ;
678
+
679
+ WebDriverJsController . prototype . onElementSubmit = function ( ) {
680
+ this . element . submit ( ) ;
681
+ } ;
682
+
683
+ WebDriverJsController . prototype . onElementClear = function ( ) {
684
+ this . element . clear ( ) ;
685
+ } ;
686
+
687
+ WebDriverJsController . prototype . onElementTagName = function ( ) {
688
+ this . element . getTagName ( ) . then ( function ( value ) {
689
+ alert ( 'Element tag name: ' + value ) ;
690
+ } ) ;
691
+ } ;
692
+
693
+ WebDriverJsController . prototype . onElementText = function ( ) {
694
+ this . element . getText ( ) . then ( function ( value ) {
695
+ alert ( 'Element text: ' + value ) ;
696
+ } ) ;
697
+ } ;
698
+
699
+ WebDriverJsController . prototype . onElementLocation = function ( ) {
700
+ this . element . getLocation ( ) . then ( function ( value ) {
701
+ alert ( 'Element location: ' + JSON . stringify ( value ) ) ;
702
+ } ) ;
703
+ } ;
704
+
705
+ WebDriverJsController . prototype . onElementSize = function ( ) {
706
+ this . element . getSize ( ) . then ( function ( value ) {
707
+ alert ( 'Element size: ' + JSON . stringify ( value ) ) ;
708
+ } ) ;
709
+ } ;
710
+
711
+ WebDriverJsController . prototype . onElementIsSelected = function ( ) {
712
+ this . element . isSelected ( ) . then ( function ( value ) {
713
+ alert ( 'Element selection: ' + value ) ;
714
+ } ) ;
715
+ } ;
716
+
717
+ WebDriverJsController . prototype . onElementIsEnabled = function ( ) {
718
+ this . element . isEnabled ( ) . then ( function ( value ) {
719
+ alert ( 'Element enabled: ' + value ) ;
720
+ } ) ;
721
+ } ;
722
+
723
+ WebDriverJsController . prototype . onElementIsDisplayed = function ( ) {
724
+ this . element . isDisplayed ( ) . then ( function ( value ) {
725
+ alert ( 'Element displayed: ' + value ) ;
726
+ } ) ;
727
+ } ;
728
+
672
729
WebDriverJsController . prototype . onSendKeys = function ( key ) {
673
730
if ( this . element ) {
674
731
this . element . sendKeys ( key ) ;
@@ -677,10 +734,6 @@ WebDriverJsController.prototype.onSendKeys = function(key) {
677
734
}
678
735
} ;
679
736
680
- WebDriverJsController . prototype . onClick = function ( ) {
681
- this . element . click ( ) ;
682
- } ;
683
-
684
737
WebDriverJsController . prototype . onListWindowHandles = function ( ) {
685
738
var self = this ;
686
739
var select = document . getElementById ( 'windowList' ) ;
0 commit comments