Let me explain what is the issue.
I am new here so please ignore my mistakes. I will try my best to explain myself.
I am having a webpage.html and I included a js script like from script or may be inside <script>
tag.
I saved something like var v ="my variable from a text box"
inside the webpage.
Now I want the var v
value from the console to view the value of it.
I tried:
nightmare.evaluate(function () {
// now we're executing inside the browser scope.
return window.YOUR_VARIABLE;
}).then(function(YOUR_VARIABLE) {
// use the value
})
Did not worked for me.
The javascript is loading during the using process in webpage and the script is :
initAvlFareEnq(e) {
var t = 0;
(Array.isArray(e.avlFareResponseDTO) ? e.avlFareResponseDTO : Array.of(e.avlFareResponseDTO)).forEach(e=>{
if (null == e.errorMessage && null == e.errorMessage) {
e.avlDayList = Array.isArray(e.avlDayList) ? e.avlDayList : Array.of(e.avlDayList);
this.multiLapJourneyDetails.lapDetails.push(i)
} else
this.messageService.add({
life: this.langService.life,
})
}
),
this.multiLapJourneyDetails.mainJourneyTxnId = this.jpInput.txnId,
this.multiLapJourneyDetails.clientTxnId = (new Date).getTime().toString(36),
}
I want this.multiLapJourneyDetails.clientTxnId value when its get executed