# How to handle authentication pop-up when the machine is lock

**URL:** <https://www.ruby-forum.com/t/how-to-handle-authentication-pop-up-when-the-machine-is-lock/195246>\
**Category:** Ruby\
**Created:** [September 20, 2010, 1:54pm UTC](https://www.ruby-forum.com/t/how-to-handle-authentication-pop-up-when-the-machine-is-lock/195246 "2010-09-20T13:54:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![parulg2386](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/4da419/32.png) [@parulg2386](https://www.ruby-forum.com/u/parulg2386)\
**Post date:** [September 20, 2010, 1:54pm UTC](https://www.ruby-forum.com/t/how-to-handle-authentication-pop-up-when-the-machine-is-lock/195246/1 "2010-09-20T13:54:00Z")

</div>

I am facing issues while handling authentication pop-up when my machine  
is locked.  
I have scheduled my ruby script to run at a particular time. The script  
does not get executed when it encounters an authentication pop-up.  
Authentication pop-up stays idle.  
Below is the peace of code which I am using. The same code works fine  
when the machine is not locked.

require ‘watir’  
require ‘ci/reporter/rake/test\_unit\_loader.rb’  
require ‘test/unit’  
require ‘watir/close\_all’  
require ‘test/unit/ui/console/testrunner’  
require ‘test/unit/ui/reporter’  
require ‘fileutils’  
include FileUtils::Verbose  
require ‘stringio’  
require ‘watir/WindowHelper’

class TestSuite\_authentication \< Test::Unit::TestCase  
def setup  
@url = ‘[stage.remotedonationtest.networkforgood.org](http://stage.remotedonationtest.networkforgood.org)’  
@login\_title = “Connect to #{@url}”

```
 @username = 'abc\test'
@password = 'testpassword'

```

end

def test\_logon  
a = Thread.new {  
system(“ruby handle\_logon.rb "#{@login\_title}" "#{@username}"  
"#{@password}"”)  
}

$ie = Watir::IE.start(@url)  
#~ $ie.goto(‘[stage.remotedonationtest.networkforgood.org](http://stage.remotedonationtest.networkforgood.org)’)

```
a.join

# continue code here...

```

end

end
