File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 131131
132132 < div style ="margin-top: 20px ">
133133 < input type ="submit " value ="Quit " onclick ="wd.onQuit() "/>
134+ < span id ="sessionIdLabel " style ="color: gray; float:right; "> </ span >
134135 </ div >
135136 </ body >
136137</ html >
Original file line number Diff line number Diff line change @@ -542,6 +542,15 @@ WebDriverJsView.prototype.updateSessionDepControls = function() {
542542 }
543543}
544544
545+ WebDriverJsView . prototype . setSessionId = function ( id ) {
546+ var element = document . getElementById ( 'sessionIdLabel' ) ;
547+ if ( id != null ) {
548+ element . innerHTML = 'Session: ' + id ;
549+ } else {
550+ element . innerHTML = '' ;
551+ }
552+ }
553+
545554WebDriverJsView . prototype . setFoundElementId = function ( id ) {
546555 var element = document . getElementById ( 'foundElement' ) ;
547556 if ( typeof id . ELEMENT === 'string' ) {
@@ -571,11 +580,16 @@ function WebDriverJsController() {
571580}
572581
573582WebDriverJsController . prototype . setServerUrl = function ( serverUrl ) {
583+ var self = this ;
574584 this . driver . setServerUrl ( serverUrl ) ;
575585
576586 this . serverUrl = serverUrl ;
577587 if ( localStorage )
578588 localStorage . serverUrl = serverUrl ;
589+
590+ this . driver . getSession ( ) . then ( function ( session ) {
591+ self . view . setSessionId ( session . getId ( ) ) ;
592+ } ) ;
579593}
580594
581595WebDriverJsController . prototype . setWebPage = function ( webPage ) {
@@ -701,6 +715,7 @@ WebDriverJsController.prototype.onQuit = function() {
701715 this . visualizer . quit ( ) ;
702716 this . webDriverUrlPort = null ;
703717 this . webPage = null ;
718+ this . view . setSessionId ( null ) ;
704719} ;
705720
706721WebDriverJsController . prototype . onWebDriverUrlPortChange = function ( ) {
You can’t perform that action at this time.
0 commit comments