Hello Team,
I have designed a jenkins pipeline for running Ranorex automation testcases for desktop application. In this, I am running the KeepSessionActive.bat to keep the session active. But instead of running successfully, It is showing the below pattern:
1. In first iteration, Application opens but not able to identify any element.
2. In second iteration, test case runs successfully.
3. Third iteration onwards, script fails with black screen in the screenshots.
Regards,
Palvi
KeepSessionActive batch script is not working while calling through jenkins pipeline
Re: KeepSessionActive batch script is not working while calling through jenkins pipeline
Hi,
I'm personally not using KeepSessionActive, so I can't comment that. Have you examine this post?...
viewtopic.php?f=20&t=11111&p=44803
I'm using LogonExpert on all our VMs and it works quite nice. It keeps the VMs open and logged in.
I'm personally not using KeepSessionActive, so I can't comment that. Have you examine this post?...
viewtopic.php?f=20&t=11111&p=44803
I'm using LogonExpert on all our VMs and it works quite nice. It keeps the VMs open and logged in.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: KeepSessionActive batch script is not working while calling through jenkins pipeline
Hello,
I am already using this below script. Given as solution in the above mentioned link. but its not working while calling from jenkins
Solution #2
Create a batch file on your remote machine and insert the code below:
Save this batch file on the desktop of your remote machine and name it ‘KeepSessionOpen.bat’. If you need to disconnect the remote session, you can now simply run this batch file using administrator rights and your remote machine will remain unlocked.
KeepSessionOpen.bat
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
%windir%\System32\tscon.exe %%s /dest:console
)
But it
I am already using this below script. Given as solution in the above mentioned link. but its not working while calling from jenkins
Solution #2
Create a batch file on your remote machine and insert the code below:
Save this batch file on the desktop of your remote machine and name it ‘KeepSessionOpen.bat’. If you need to disconnect the remote session, you can now simply run this batch file using administrator rights and your remote machine will remain unlocked.
KeepSessionOpen.bat
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
%windir%\System32\tscon.exe %%s /dest:console
)
But it
Re: KeepSessionActive batch script is not working while calling through jenkins pipeline
Hi,
As I mentioned, I'm not using this workaround to make the machine alive, so I can't comment why it does not work if called form Jenkins. It may be blocked by UAC or GOP, or something completely different? Have you tried to find a solution on Jenkins-related forums (or google it)?
It's just a workaround, which may, but may not work. So you should not rely on this solution and rather to find something more reliable, as for example the mentioned LogonExpert, which does exactly what it advertises
As I mentioned, I'm not using this workaround to make the machine alive, so I can't comment why it does not work if called form Jenkins. It may be blocked by UAC or GOP, or something completely different? Have you tried to find a solution on Jenkins-related forums (or google it)?
It's just a workaround, which may, but may not work. So you should not rely on this solution and rather to find something more reliable, as for example the mentioned LogonExpert, which does exactly what it advertises
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: KeepSessionActive batch script is not working while calling through jenkins pipeline
this script works ! ( i'm using the same)
The black screen tells me their might be screensaver kicking in in after some time.
Make sure you disabled all kind of screensavers / power saving stuff
You could use some additional powershell scripts which are started at logon,
it does minimal mouse move and use scrolllock key to emulate a user being active (when possible with your sut) :
Add-Type -AssemblyName System.Windows.Forms
Clear-Host
Echo "Keep-alive with Scroll Lock...and mouse move"
$WShell = New-Object -com "Wscript.Shell"
while ($true)
{
$WShell.sendkeys("{SCROLLLOCK}")
Start-Sleep -Milliseconds 100
$WShell.sendkeys("{SCROLLLOCK}")
$Pos = [System.Windows.Forms.Cursor]::Position
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point((($Pos.X) + 1) , $Pos.Y)
Start-Sleep -Milliseconds 100
$Pos = [System.Windows.Forms.Cursor]::Position
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point((($Pos.X) - 1) , $Pos.Y)
Start-Sleep -Seconds 240
}
( do you have auto login enabled as well ? which means jenkins node connects after reboot )
The black screen tells me their might be screensaver kicking in in after some time.
Make sure you disabled all kind of screensavers / power saving stuff
You could use some additional powershell scripts which are started at logon,
it does minimal mouse move and use scrolllock key to emulate a user being active (when possible with your sut) :
Add-Type -AssemblyName System.Windows.Forms
Clear-Host
Echo "Keep-alive with Scroll Lock...and mouse move"
$WShell = New-Object -com "Wscript.Shell"
while ($true)
{
$WShell.sendkeys("{SCROLLLOCK}")
Start-Sleep -Milliseconds 100
$WShell.sendkeys("{SCROLLLOCK}")
$Pos = [System.Windows.Forms.Cursor]::Position
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point((($Pos.X) + 1) , $Pos.Y)
Start-Sleep -Milliseconds 100
$Pos = [System.Windows.Forms.Cursor]::Position
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point((($Pos.X) - 1) , $Pos.Y)
Start-Sleep -Seconds 240
}
( do you have auto login enabled as well ? which means jenkins node connects after reboot )