I create a virtual monitor in jenkins file using:
wrap([$class: 'Xvfb', screen: '1920x1080x24']) {
// my steps here
}
The out is:
Xvfb starting$ Xvfb :0 -screen 0 1920x1080x24 -fbdir /var/lib/jenkins/xvfb-2-6842399732643585931.fbdir
I can't specify particular display name offset, so it can vary, but I need to use its value (O in this example) later in my build scripts. Is there an env variable for this or what is the best way to get this number?