[wtr-general] Re: How to judge the button or link exists in the page?
Yet,It works fine,thanks for all of your guys! On Aug 8, 10:14 am, Marlon Mojares marlonmoja...@gmail.com wrote: I hope this helps *if link:* begin assert(ie.link(:name,Signout).exists?) puts login successfully rescue = e puts login failed + e.message + \n + e.backtrace.join(\n) end *if button:* begin assert(ie.button(:name,Signout).exists?) puts login successfully rescue = e puts login failed + e.message + \n + e.backtrace.join(\n) end thanks! --~--~-~--~~~---~--~~ 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: How to judge the button or link exists in the page?
assert($browser.link(:text,Signout)exists?),The sign-out link is absent) On Fri, Aug 7, 2009 at 2:25 PM, yuping zhong littlezhong...@gmail.comwrote: Dear all, Right now, I want to use the watir to check the button or link if exists in the page. Who can help me? Such as, I write the watir code to login the gmail. In order to make sure I login successfully, I try to check whether the Sign Out link is exists in the page. If the Sign Out link is exists,puts login successfully,else puts login failure. But how to write the code? It is easy If check the TEXT in the page, what should I do about the LINK or BUTTON? Thanks for anyone replys. Best Wishes! -Zhong --~--~-~--~~~---~--~~ 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: How to judge the button or link exists in the page?
And what you need will be: assert($browser.link(:text,Signout)exists?),login failure) puts Login was successful On Fri, Aug 7, 2009 at 2:29 PM, Smruti Ranjan Kar smrutiranjan@gmail.com wrote: assert($browser.link(:text,Signout)exists?),The sign-out link is absent) On Fri, Aug 7, 2009 at 2:25 PM, yuping zhong littlezhong...@gmail.comwrote: Dear all, Right now, I want to use the watir to check the button or link if exists in the page. Who can help me? Such as, I write the watir code to login the gmail. In order to make sure I login successfully, I try to check whether the Sign Out link is exists in the page. If the Sign Out link is exists,puts login successfully,else puts login failure. But how to write the code? It is easy If check the TEXT in the page, what should I do about the LINK or BUTTON? Thanks for anyone replys. Best Wishes! -Zhong --~--~-~--~~~---~--~~ 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: How to judge the button or link exists in the page?
I hope this helps *if link:* begin assert(ie.link(:name,Signout).exists?) puts login successfully rescue = e puts login failed + e.message + \n + e.backtrace.join(\n) end *if button:* begin assert(ie.button(:name,Signout).exists?) puts login successfully rescue = e puts login failed + e.message + \n + e.backtrace.join(\n) end thanks! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---