[wtr-general] Re: Read text from a text_field
Daca and Jason..Thanks for your replies also Gem (newbie) Dandy On Jan 9, 10:02 pm, gem dandy wrote: > Darin - thanks for your reply. > > Carl - thanks again for your reply > > Thanks to everyone! > > Below is the final solution to my questions: > > /// > $ie.goto test_site > > #Reveal text on the support page - System name > > # Go to the Support tab > ## Image HTML: name=imgSupport> > $ie.frame(:index, 2).image(:id, 'imgSupport').flash > $ie.frame(:index, 2).image(:id, 'imgSupport').click > > # Flash the table cell System Name text > $ie.frame(:index, 3).frame(:index, 3).table(:index, > 2)[2][2].flash > > # Reveal the System Name text > myValue = $ie.frame(:index, 3).frame(:index, > 3).table(:index, 2)[2] > [2].to_s > > puts "My value is " + myValue > sleep 1 > > if (myValue == "GXT Demo") > puts "Test passed" > else > puts "Test failed" > end > > $ie.close > \\\ > \\\ > > * > > On Jan 9, 4:40 pm, "Darin Duphorn" > wrote: > > - Hide quoted text - > - Show quoted text - > > > > > Can you replace .flash with .text? > > # Flash the table cell "System Name" text" > > $ie.frame(:index, 3).frame(:index, > > 3).table(:index, 2)[2][2].text > > -Original Message- > > From: watir-general@googlegroups.com > > [mailto:watir-gene...@googlegroups.com] On Behalf Of gem dandy > > Sent: Friday, January 09, 2009 3:37 PM > > To: Watir General > > Subject: [wtr-general] Need to reveal a string from a in a table so that > > it can be validated > > Below is code that is an attempt to reveal a text string in a table. I > > have identified the filed correctly as I can flash it. > > I'm using the "to_s" method but how do I reveal the string. > > I need to do this to validate that the string is correct > > > > $ie.goto test_site > > #Reveal text on the support page - System name > > # Go to the Support tab > ## Image HTML: name=imgSupport> > $ie.frame(:index, 2).image(:id, > 'imgSupport').flash > $ie.frame(:index, 2).image(:id, > 'imgSupport').click > > # Flash the table cell "System Name" text" > $ie.frame(:index, 3).frame(:index, 3).table > (:index, 2)[2][2].flash > > # Reveal the System Text name > myValue = $ie.frame(:index, 3).frame(:index, > 3).table(:index, 2)[2] > [2].to_s > > puts "My value is " + myValue > sleep 5 > > $ie.close > > > On Jan 9, 10:37 am, Daca wrote: > > > Gem, > > > for 1. try > > > my_value = $ie.frame(:index, 3).frame(:index, 3).form(:name, > > 'configSnmpAccess').text_field(:name, 'accessIpAddress?3').value > > > - now your value is stored in my_value variable > > > for 2. try > > > if ( my_value.text == "What you want to comapare it with") then > > do something. > > > btw. to make the value appear in the command window, u have to use 1. > > above...followed by > > puts my_value > > On Jan 8, 10:25 pm, gem dandy wrote: > > > > OK - Next dumb questions - > > > > 1) where should the value appear? I though that it would show up in > > > the command window > > > > 2) Once I can get hold of the value, what is the simple syntax for the > > > compare. > > > > Again thanks, > > > > Gem > > > > On Jan 8, 10:01 pm, Jason wrote: > > > > > Try: > > > > > $ie.frame(:index, 3).frame(:index, 3).form(:name, > > > > 'configSnmpAccess').text_field(:name, 'accessIpAddress?3').value > > > > > - J- Hide quoted text - > > > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Read text from a text_field
Darin - thanks for your reply. Carl - thanks again for your reply Thanks to everyone! Below is the final solution to my questions: /// $ie.goto test_site #Reveal text on the support page - System name # Go to the Support tab ## Image HTML: $ie.frame(:index, 2).image(:id, 'imgSupport').flash $ie.frame(:index, 2).image(:id, 'imgSupport').click # Flash the table cell System Name text $ie.frame(:index, 3).frame(:index, 3).table(:index, 2)[2][2].flash # Reveal the System Name text myValue = $ie.frame(:index, 3).frame(:index, 3).table(:index, 2)[2] [2].to_s puts "My value is " + myValue sleep 1 if (myValue == "GXT Demo") puts "Test passed" else puts "Test failed" end $ie.close \\\ \\\ * On Jan 9, 4:40 pm, "Darin Duphorn" wrote: - Hide quoted text - - Show quoted text - > Can you replace .flash with .text? > # Flash the table cell "System Name" text" > $ie.frame(:index, 3).frame(:index, > 3).table(:index, 2)[2][2].text > -Original Message- > From: watir-general@googlegroups.com > [mailto:watir-gene...@googlegroups.com] On Behalf Of gem dandy > Sent: Friday, January 09, 2009 3:37 PM > To: Watir General > Subject: [wtr-general] Need to reveal a string from a in a table so that > it can be validated > Below is code that is an attempt to reveal a text string in a table. I > have identified the filed correctly as I can flash it. > I'm using the "to_s" method but how do I reveal the string. > I need to do this to validate that the string is correct > $ie.goto test_site #Reveal text on the support page - System name # Go to the Support tab ## Image HTML: $ie.frame(:index, 2).image(:id, 'imgSupport').flash $ie.frame(:index, 2).image(:id, 'imgSupport').click # Flash the table cell "System Name" text" $ie.frame(:index, 3).frame(:index, 3).table (:index, 2)[2][2].flash # Reveal the System Text name myValue = $ie.frame(:index, 3).frame(:index, 3).table(:index, 2)[2] [2].to_s puts "My value is " + myValue sleep 5 $ie.close On Jan 9, 10:37 am, Daca wrote: > Gem, > > for 1. try > > my_value = $ie.frame(:index, 3).frame(:index, 3).form(:name, > 'configSnmpAccess').text_field(:name, 'accessIpAddress?3').value > > - now your value is stored in my_value variable > > for 2. try > > if ( my_value.text == "What you want to comapare it with") then > do something. > > btw. to make the value appear in the command window, u have to use 1. > above...followed by > puts my_value > On Jan 8, 10:25 pm, gem dandy wrote: > > > OK - Next dumb questions - > > > 1) where should the value appear? I though that it would show up in > > the command window > > > 2) Once I can get hold of the value, what is the simple syntax for the > > compare. > > > Again thanks, > > > Gem > > > On Jan 8, 10:01 pm, Jason wrote: > > > > Try: > > > > $ie.frame(:index, 3).frame(:index, 3).form(:name, > > > 'configSnmpAccess').text_field(:name, 'accessIpAddress?3').value > > > > - J- Hide quoted text - > > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Read text from a text_field
Gem, for 1. try my_value = $ie.frame(:index, 3).frame(:index, 3).form(:name, 'configSnmpAccess').text_field(:name, 'accessIpAddress?3').value - now your value is stored in my_value variable for 2. try if ( my_value.text == "What you want to comapare it with") then do something. btw. to make the value appear in the command window, u have to use 1. above...followed by puts my_value On Jan 8, 10:25 pm, gem dandy wrote: > OK - Next dumb questions - > > 1) where should the value appear? I though that it would show up in > the command window > > 2) Once I can get hold of the value, what is the simple syntax for the > compare. > > Again thanks, > > Gem > > On Jan 8, 10:01 pm, Jason wrote: > > > > > Try: > > > $ie.frame(:index, 3).frame(:index, 3).form(:name, > > 'configSnmpAccess').text_field(:name, 'accessIpAddress?3').value > > > - J- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Read text from a text_field
OK - Next dumb questions - 1) where should the value appear? I though that it would show up in the command window 2) Once I can get hold of the value, what is the simple syntax for the compare. Again thanks, Gem On Jan 8, 10:01 pm, Jason wrote: > Try: > > $ie.frame(:index, 3).frame(:index, 3).form(:name, > 'configSnmpAccess').text_field(:name, 'accessIpAddress?3').value > > - J --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Read text from a text_field
Try: $ie.frame(:index, 3).frame(:index, 3).form(:name, 'configSnmpAccess').text_field(:name, 'accessIpAddress?3').value - J --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---