Search results for 'watir'

WATIR javascript alert 창 처리하는 법

ruby 소스

# test.rb

require 'watir'
include Watir

test_site = 'http://localhost/test.html'

ie = IE.new

ie.goto(test_site)

Thread.new { system("rubyw \"jscriptExtraAlert.rb\"") }

ie.button(:id, 'btnAlert').click

ie.close


# jscriptExtraAlert.rb

require 'watir/WindowHelper'

helper = WindowHelper.new
helper.push_alert_button()


HTML

<HTML>

 <HEAD>
 
  <TITLE> New Document </TITLE>
 
  <script type="text/javascript">
    function test(){
        alert('test');
    }
  </script>
 </HEAD>

 <BODY>
 
 <form>
        <input type="button" id="btnAlert" value="clickMe" OnClick="test();" />
       
 </form>       
 
 </BODY>

</HTML>

2007/02/26 22:35 2007/02/26 22:35
Trackback Address:이 글에는 트랙백을 보낼 수 없습니다