@@ -555,10 +555,13 @@ WebDriverJsView.prototype.setFoundElementId = function(id) {
555555 var element = document . getElementById ( 'foundElement' ) ;
556556 if ( typeof id . ELEMENT === 'string' ) {
557557 element . innerHTML = 'Found element ' + id . ELEMENT ;
558+ element . style . visibility = 'visible' ;
559+ document . getElementById ( 'elementActions' ) . style . visibility = 'visible' ;
558560 } 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' ;
560564 }
561- element . style . visibility = 'visible' ;
562565}
563566
564567WebDriverJsView . prototype . setError = function ( message ) {
@@ -669,6 +672,60 @@ WebDriverJsController.prototype.onFindElement = function() {
669672 } ) ;
670673} ;
671674
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+
672729WebDriverJsController . prototype . onSendKeys = function ( key ) {
673730 if ( this . element ) {
674731 this . element . sendKeys ( key ) ;
@@ -677,10 +734,6 @@ WebDriverJsController.prototype.onSendKeys = function(key) {
677734 }
678735} ;
679736
680- WebDriverJsController . prototype . onClick = function ( ) {
681- this . element . click ( ) ;
682- } ;
683-
684737WebDriverJsController . prototype . onListWindowHandles = function ( ) {
685738 var self = this ;
686739 var select = document . getElementById ( 'windowList' ) ;
0 commit comments