added "password" field type finder
git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@2987 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -6,7 +6,7 @@ include Watir
|
||||
#
|
||||
#Set the page you want WATIR to grab all the fields and buttons for here
|
||||
#
|
||||
MYPAGE = "http://loordv01/pls/apex/f?p=102:32"
|
||||
MYPAGE = "http://loordv01/pls/apex/f?p=102:101"
|
||||
|
||||
@@ie = IE.new
|
||||
@@ie.maximize
|
||||
@@ -15,10 +15,10 @@ MYPAGE = "http://loordv01/pls/apex/f?p=102:32"
|
||||
|
||||
@@ie.goto(MYPAGE)
|
||||
@@ie.wait
|
||||
@@ie.text_field( :id, 'P101_USERNAME' ).set( 'advantica' )
|
||||
@@ie.text_field( :id, 'P101_PASSWORD' ).set( 'password' )
|
||||
@@ie.button(:id, "login").click
|
||||
@@ie.wait
|
||||
#@@ie.text_field( :id, 'P101_USERNAME' ).set( 'advantica' )
|
||||
#@@ie.text_field( :id, 'P101_PASSWORD' ).set( 'password' )
|
||||
#@@ie.button(:id, "login").click
|
||||
#@@ie.wait
|
||||
|
||||
#Get the ole object
|
||||
doc = @@ie.document
|
||||
@@ -55,6 +55,11 @@ begin
|
||||
davalue = n.invoke('id').to_s
|
||||
puts "assert(@@ie.text_field(:id,'"+davalue+"').exists?,'Could not find "+davalue+" file upload field')"
|
||||
i=i+1
|
||||
end
|
||||
if n.invoke("type").to_s == 'password'
|
||||
davalue = n.invoke('id').to_s
|
||||
puts "assert(@@ie.text_field(:id,'"+davalue+"').exists?,'Could not find "+davalue+" file upload field')"
|
||||
i=i+1
|
||||
end
|
||||
rescue #if we invoke a type method that doesn't exist get the next element
|
||||
next
|
||||
|
||||
Reference in New Issue
Block a user