Re: [wtr-general] facing issue with clicking buttons
On Thu, Jul 22, 2010 at 2:42 PM, praveen kumar praveen454gr...@gmail.com wrote: I am trying to automate the gmail Why? Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them vidipodkast.com - pričamo o hardveru, softveru i časopisu Vidi -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] facing issue with clicking buttons
Hi Raveendran, Thanks for the reply... I tried with the all the possibilities you provided.None of them are working. Getting error as Unable to locate element. Please let me know if any other options. Thanks, Praveen On Tue, Jul 27, 2010 at 11:09 AM, Raveendran P jazzezr...@gmail.com wrote: Hi Praveen, Have you tried these possibilities ? *canvas_frame.div(:class, 'J-Zh-I J-J5-Ji Bq L3').flash* * canvas_frame.div(:id, ': 15m ').flash canvas_frame.div(:id, ': 15m ').flash * On Fri, Jul 23, 2010 at 1:32 PM, praveen kumar praveen454gr...@gmail.comwrote: Hi John, I have tried with div, but unable to click on button. Following is the code: require 'watir' require 'test/unit' require 'win32ole' class TC_article_example Test::Unit::TestCase def test_data $ie = Watir::IE.new $ie.goto(http://mail.google.com/mail/?ui=html;) #Define the excel file excel= WIN32OLE::new(excel.Application) wrkbook=excel.Workbooks.Open(C:\\test.xls) wrksheet = wrkbook.worksheets(1) wrksheet.select #read the data from excel file rows = 2 $username=wrksheet.cells(rows,A) ['text'] #puts $field $password=wrksheet.cells(rows,B) ['text'] $ie.text_field(:name,Email).set($username) $ie.text_field(:id,Passwd).set($password) $ie.button(:id, 'signIn' ).click #browser.show_frames # We need the iframe with ID 'canvas_frame'. Store it in a var. #$ie.goto(http://mail.google.com/mail/?ui=html;) canvas_frame = $ie.frame(:id, 'canvas_frame') # Get the current user's email address. We'll be sending email to it. my_address = $username mail_subject = 'Hello Watir world!' mail_body_text = 'Hi.' canvas_frame.span(:text, 'Compose Mail').click # Compose new mail canvas_frame.text_field(:name, 'to').set(my_address) canvas_frame.text_field(:name, 'subject').set(mail_subject) mail_body_frame = canvas_frame.frame(:index, 1) mail_body_frame.document.body.setproperty('innerText', mail_body_text) #$ie.goto(http://mail.google.com/mail/?ui=html;) * canvas_frame.div(:text, 'Send').click# Send the message I am facing problem here to click on Send button. It has no attributes like type, value* #canvas_frame.link(:text, 'Sent Mail').click # Browse to sent mail page #assert(canvas_frame.contains_text('Hello Watir world!')) #canvas_frame.link(:text, 'Inbox').click # Return to the inbox page $ie.link(:href,'https://mail.google.com/mail/?logouthl=en').clickhttps://mail.google.com/mail/?logouthl=en%27%29.click $ie.close #rows=rows+1 end end I have also tried with the attribute id, but that is also not working. Please help me and let me know if require any details. Praveen On Thu, Jul 22, 2010 at 10:23 PM, John Fitisoff jfitis...@yahoo.comwrote: Try treating it as a div rather than a button? -- *From:* praveen kumar praveen454gr...@gmail.com *To:* watir-general@googlegroups.com *Sent:* Thu, July 22, 2010 5:42:59 AM *Subject:* [wtr-general] facing issue with clicking buttons Hi All, I am trying to automate the gmail by clicking on the compose mail and entering to address , subject and body content. I am facing problem in clicking the Send button. The button has following HTML elements *div tabindex=1 class=J-Zh-I J-J5-Ji Bq L3 id=:15m role=button style=-moz-user-select: none;bSend/b/div * I have tried with following script *canvas_frame.button(:text, 'Send').click * canvas_frame is the variable in which the frame is stored. I am confusing because there is no type attribute. It has role attribute i.e role=button. Please help me in going forward... Thanks, Praveen -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Regards, P.Raveendran http://raveendran.wordpress.com -- Before posting, please read http://watir.com/support. In short: search before you
Re: [wtr-general] facing issue with clicking buttons
Hi Praveen, Have you tried these possibilities ? *canvas_frame.div(:class, 'J-Zh-I J-J5-Ji Bq L3').flash* * canvas_frame.div(:id, ': 15m ').flash canvas_frame.div(:id, ': 15m ').flash * On Fri, Jul 23, 2010 at 1:32 PM, praveen kumar praveen454gr...@gmail.comwrote: Hi John, I have tried with div, but unable to click on button. Following is the code: require 'watir' require 'test/unit' require 'win32ole' class TC_article_example Test::Unit::TestCase def test_data $ie = Watir::IE.new $ie.goto(http://mail.google.com/mail/?ui=html;) #Define the excel file excel= WIN32OLE::new(excel.Application) wrkbook=excel.Workbooks.Open(C:\\test.xls) wrksheet = wrkbook.worksheets(1) wrksheet.select #read the data from excel file rows = 2 $username=wrksheet.cells(rows,A) ['text'] #puts $field $password=wrksheet.cells(rows,B) ['text'] $ie.text_field(:name,Email).set($username) $ie.text_field(:id,Passwd).set($password) $ie.button(:id, 'signIn' ).click #browser.show_frames # We need the iframe with ID 'canvas_frame'. Store it in a var. #$ie.goto(http://mail.google.com/mail/?ui=html;) canvas_frame = $ie.frame(:id, 'canvas_frame') # Get the current user's email address. We'll be sending email to it. my_address = $username mail_subject = 'Hello Watir world!' mail_body_text = 'Hi.' canvas_frame.span(:text, 'Compose Mail').click # Compose new mail canvas_frame.text_field(:name, 'to').set(my_address) canvas_frame.text_field(:name, 'subject').set(mail_subject) mail_body_frame = canvas_frame.frame(:index, 1) mail_body_frame.document.body.setproperty('innerText', mail_body_text) #$ie.goto(http://mail.google.com/mail/?ui=html;) * canvas_frame.div(:text, 'Send').click# Send the message I am facing problem here to click on Send button. It has no attributes like type, value* #canvas_frame.link(:text, 'Sent Mail').click # Browse to sent mail page #assert(canvas_frame.contains_text('Hello Watir world!')) #canvas_frame.link(:text, 'Inbox').click # Return to the inbox page $ie.link(:href,'https://mail.google.com/mail/?logouthl=en').click $ie.close #rows=rows+1 end end I have also tried with the attribute id, but that is also not working. Please help me and let me know if require any details. Praveen On Thu, Jul 22, 2010 at 10:23 PM, John Fitisoff jfitis...@yahoo.comwrote: Try treating it as a div rather than a button? -- *From:* praveen kumar praveen454gr...@gmail.com *To:* watir-general@googlegroups.com *Sent:* Thu, July 22, 2010 5:42:59 AM *Subject:* [wtr-general] facing issue with clicking buttons Hi All, I am trying to automate the gmail by clicking on the compose mail and entering to address , subject and body content. I am facing problem in clicking the Send button. The button has following HTML elements *div tabindex=1 class=J-Zh-I J-J5-Ji Bq L3 id=:15m role=button style=-moz-user-select: none;bSend/b/div * I have tried with following script *canvas_frame.button(:text, 'Send').click * canvas_frame is the variable in which the frame is stored. I am confusing because there is no type attribute. It has role attribute i.e role=button. Please help me in going forward... Thanks, Praveen -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Regards, P.Raveendran http://raveendran.wordpress.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] facing issue with clicking buttons
Hi John, I have tried with div, but unable to click on button. Following is the code: require 'watir' require 'test/unit' require 'win32ole' class TC_article_example Test::Unit::TestCase def test_data $ie = Watir::IE.new $ie.goto(http://mail.google.com/mail/?ui=html;) #Define the excel file excel= WIN32OLE::new(excel.Application) wrkbook=excel.Workbooks.Open(C:\\test.xls) wrksheet = wrkbook.worksheets(1) wrksheet.select #read the data from excel file rows = 2 $username=wrksheet.cells(rows,A) ['text'] #puts $field $password=wrksheet.cells(rows,B) ['text'] $ie.text_field(:name,Email).set($username) $ie.text_field(:id,Passwd).set($password) $ie.button(:id, 'signIn' ).click #browser.show_frames # We need the iframe with ID 'canvas_frame'. Store it in a var. #$ie.goto(http://mail.google.com/mail/?ui=html;) canvas_frame = $ie.frame(:id, 'canvas_frame') # Get the current user's email address. We'll be sending email to it. my_address = $username mail_subject = 'Hello Watir world!' mail_body_text = 'Hi.' canvas_frame.span(:text, 'Compose Mail').click # Compose new mail canvas_frame.text_field(:name, 'to').set(my_address) canvas_frame.text_field(:name, 'subject').set(mail_subject) mail_body_frame = canvas_frame.frame(:index, 1) mail_body_frame.document.body.setproperty('innerText', mail_body_text) #$ie.goto(http://mail.google.com/mail/?ui=html;) * canvas_frame.div(:text, 'Send').click# Send the message I am facing problem here to click on Send button. It has no attributes like type, value* #canvas_frame.link(:text, 'Sent Mail').click # Browse to sent mail page #assert(canvas_frame.contains_text('Hello Watir world!')) #canvas_frame.link(:text, 'Inbox').click # Return to the inbox page $ie.link(:href,'https://mail.google.com/mail/?logouthl=en').click $ie.close #rows=rows+1 end end I have also tried with the attribute id, but that is also not working. Please help me and let me know if require any details. Praveen On Thu, Jul 22, 2010 at 10:23 PM, John Fitisoff jfitis...@yahoo.com wrote: Try treating it as a div rather than a button? -- *From:* praveen kumar praveen454gr...@gmail.com *To:* watir-general@googlegroups.com *Sent:* Thu, July 22, 2010 5:42:59 AM *Subject:* [wtr-general] facing issue with clicking buttons Hi All, I am trying to automate the gmail by clicking on the compose mail and entering to address , subject and body content. I am facing problem in clicking the Send button. The button has following HTML elements *div tabindex=1 class=J-Zh-I J-J5-Ji Bq L3 id=:15m role=button style=-moz-user-select: none;bSend/b/div * I have tried with following script *canvas_frame.button(:text, 'Send').click * canvas_frame is the variable in which the frame is stored. I am confusing because there is no type attribute. It has role attribute i.e role=button. Please help me in going forward... Thanks, Praveen -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] facing issue with clicking buttons
Hi All, I am trying to automate the gmail by clicking on the compose mail and entering to address , subject and body content. I am facing problem in clicking the Send button. The button has following HTML elements *div tabindex=1 class=J-Zh-I J-J5-Ji Bq L3 id=:15m role=button style=-moz-user-select: none;bSend/b/div * I have tried with following script *canvas_frame.button(:text, 'Send').click * canvas_frame is the variable in which the frame is stored. I am confusing because there is no type attribute. It has role attribute i.e role=button. Please help me in going forward... Thanks, Praveen -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com