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:
mullenm
2007-12-14 09:54:32 +00:00
parent c22e712a33
commit e227875010

View File

@@ -6,7 +6,7 @@ include Watir
# #
#Set the page you want WATIR to grab all the fields and buttons for here #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 = IE.new
@@ie.maximize @@ie.maximize
@@ -15,10 +15,10 @@ MYPAGE = "http://loordv01/pls/apex/f?p=102:32"
@@ie.goto(MYPAGE) @@ie.goto(MYPAGE)
@@ie.wait @@ie.wait
@@ie.text_field( :id, 'P101_USERNAME' ).set( 'advantica' ) #@@ie.text_field( :id, 'P101_USERNAME' ).set( 'advantica' )
@@ie.text_field( :id, 'P101_PASSWORD' ).set( 'password' ) #@@ie.text_field( :id, 'P101_PASSWORD' ).set( 'password' )
@@ie.button(:id, "login").click #@@ie.button(:id, "login").click
@@ie.wait #@@ie.wait
#Get the ole object #Get the ole object
doc = @@ie.document doc = @@ie.document
@@ -55,6 +55,11 @@ begin
davalue = n.invoke('id').to_s davalue = n.invoke('id').to_s
puts "assert(@@ie.text_field(:id,'"+davalue+"').exists?,'Could not find "+davalue+" file upload field')" puts "assert(@@ie.text_field(:id,'"+davalue+"').exists?,'Could not find "+davalue+" file upload field')"
i=i+1 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 end
rescue #if we invoke a type method that doesn't exist get the next element rescue #if we invoke a type method that doesn't exist get the next element
next next