Hello Guys,
Again I am having trouble about my testing? I got this warnings in the
inspect element console when I try to execute my codes [below].
Use of getPreventDefault() is deprecated. Use defaultPrevented instead.
jquery.min.js:3
Use of getAttributeNode() is deprecated. Use getAttribute() instead.
Security wrapper denied access to property length on privileged Javascript
object. Support for exposing privileged objects to untrusted content via
__exposedProps__ is being gradually removed - use WebIDL bindings or
Components.utils.cloneInto instead. Note that only the first denied
property access from a given global object will be reported.
My codes:
require 'watir-webdriver'
require 'minitest/autorun'
require "win32ole"
class Login < Minitest::Unit::TestCase
$number_of_fails = 0
$number_of_success = 0
$fields = ["first_name", "middle_name", "last_name", "sss_number",
"tin_number"]
def test_in()
@browser =Watir::Browser.new :firefox
@browser.goto 'http://gw01.nextix.org/login'
accept_next_alert=true
@browser.driver.manage.window.maximize
excel= WIN32OLE::new("excel.Application")
wrkbook=excel.Workbooks.Open("C:\\testing\\inputs.xlsx")
wrksheet = wrkbook.worksheets(1)
wrksheet.select
# -------- Authentication / Login Part ---------------
rows = 2
while rows <= 5
$username = wrksheet.cells(rows, "A").value
$password = wrksheet.cells(rows, "B").value
@browser.text_field(:name, "username").set($username)
sleep 3
@browser.text_field(:name, "password").set($password)
sleep 3
@browser.button(:name => 'login').click
sleep 3
rows = rows + 1
end
# ------------- Before Adding a new User
$Dashboard = @browser.link(:text, "Dashboard")
$Dashboard.exists?
$Dashboard.click
@browser.link(:text, "Users").click
@browser.button(:value,"Add New User").click
# >>>>>> Add new User <<<<<<<
# Personal Information Block
@browser.send_keys :f12
rows = 8
while rows <= 13
$to_enter = [wrksheet.cells(rows, "A").value, wrksheet.cells(
rows, "B").value, wrksheet.cells(rows, "C").value, wrksheet.cells(rows, "D"
).value, wrksheet.cells(rows, "E").value]
@browser.text_field(:id, $fields[0]).set($to_enter[0])
sleep 5
@browser.text_field(:id, $fields[1]).set($to_enter[1])
sleep 5
@browser.text_field(:id, $fields[2]).set($to_enter[2])
sleep 5
@browser.text_field(:id, $fields[3]).set($to_enter[3])
sleep 5
@browser.text_field(:id, $fields[4]).set($to_enter[4])
@browser.send_keys :tab
rows += 1
(0..4).each do |i|
if @browser.text_field(:id => $fields[i], :aria_invalid =>
"true").exist?
$number_of_success = $number_of_success + 1
puts @browser.execute_script('return
document.getElementsByClassName("form-control")[0];')
else
$number_of_fails = $number_of_fails + 1
end
end
end
puts "Number of Success: #{$number_of_success}"
puts "Number of Failures: #{$number_of_fails}"
end
end
Then after the execution I got this kind of output:
E
User1@DOCUMENTATIONS /c/testing
$ ruby revised_login.rb
Warning: you should require 'minitest/autorun' instead.
Warning: or add 'gem "minitest"' before 'require "minitest/autorun"'
From:
c:/Ruby193/lib/ruby/1.9.1/minitest/autorun.rb:14:in `<top (required)>'
revised_login.rb:2:in `<main>'
MiniTest::Unit.autorun is now Minitest.autorun. From
c:/Ruby193/lib/ruby/1.9.1/m
initest/autorun.rb:18:in `<top (required)>'
MiniTest::Unit::TestCase is now Minitest::Test. From revised_login.rb:5:in
`<mai
n>'
Run options: --seed 1754
# Running:
#<Watir::Input:0x27d9b90>
#<Watir::Input:0x350d888>
#<Watir::Input:0x1c8b7d8>
#<Watir::Input:0x250c7e8>
#<Watir::Input:0x2759f58>
#<Watir::Input:0x2415ed0>
#<Watir::Input:0x2754c48>
#<Watir::Input:0x27b0298>
#<Watir::Input:0x27c17a0>
#<Watir::Input:0x27ed498>
#<Watir::Input:0x350d228>
#<Watir::Input:0x35444d0>
#<Watir::Input:0x24160c8>
#<Watir::Input:0x1c8b7d8>
#<Watir::Input:0x250dad8>
#<Watir::Input:0x275aac8>
#<Watir::Input:0x27c4110>
#<Watir::Input:0x27dfe30>
#<Watir::Input:0x27bf3e8>
#<Watir::Input:0x27e9c88>
#<Watir::Input:0x351ad40>
#<Watir::Input:0x231da58>
#<Watir::Input:0x25407c0>
Number of Success: 23
Number of Failures: 7
.
Finished in 348.946844s, 0.0029 runs/s, 0.0000 assertions/s.
1 runs, 0 assertions, 0 failures, 0 errors, 0 skips
User1@DOCUMENTATIONS /c/testing
$
Can someone help me understand all of these?
Thanks in advance :)
Ping
--
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.