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 131
131
132
132
< div style ="margin-top: 20px ">
133
133
< input type ="submit " value ="Quit " onclick ="wd.onQuit() "/>
134
+ < span id ="sessionIdLabel " style ="color: gray; float:right; "> </ span >
134
135
</ div >
135
136
</ body >
136
137
</ html >
Original file line number Diff line number Diff line change @@ -542,6 +542,15 @@ WebDriverJsView.prototype.updateSessionDepControls = function() {
542
542
}
543
543
}
544
544
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
+
545
554
WebDriverJsView . prototype . setFoundElementId = function ( id ) {
546
555
var element = document . getElementById ( 'foundElement' ) ;
547
556
if ( typeof id . ELEMENT === 'string' ) {
@@ -571,11 +580,16 @@ function WebDriverJsController() {
571
580
}
572
581
573
582
WebDriverJsController . prototype . setServerUrl = function ( serverUrl ) {
583
+ var self = this ;
574
584
this . driver . setServerUrl ( serverUrl ) ;
575
585
576
586
this . serverUrl = serverUrl ;
577
587
if ( localStorage )
578
588
localStorage . serverUrl = serverUrl ;
589
+
590
+ this . driver . getSession ( ) . then ( function ( session ) {
591
+ self . view . setSessionId ( session . getId ( ) ) ;
592
+ } ) ;
579
593
}
580
594
581
595
WebDriverJsController . prototype . setWebPage = function ( webPage ) {
@@ -701,6 +715,7 @@ WebDriverJsController.prototype.onQuit = function() {
701
715
this . visualizer . quit ( ) ;
702
716
this . webDriverUrlPort = null ;
703
717
this . webPage = null ;
718
+ this . view . setSessionId ( null ) ;
704
719
} ;
705
720
706
721
WebDriverJsController . prototype . onWebDriverUrlPortChange = function ( ) {
You can’t perform that action at this time.
0 commit comments