It is a little complex about the script. If you want the comment before the first "Delete" button, you can try below code: $ie.button(:class =>"MS_OneMerck_CommentSubmit", :index=>1).parent.parent.cell(:index,1).texte
If you want the comment before the second "delete" button, you just need change the :index =>2 in the code above. Expect it could help. Thanks. Wesley Chen. On Mon, Jun 15, 2009 at 8:12 PM, Rahul Ahuja <[email protected]> wrote: > > Hi, > > I am facing a similar issue at some other page in the application. > > Here is the sample HTML code for your ready reference: > The text I am interested in is: "Comments: This is article is for > validating comments enabling using automation " > > The attributes associated with it are: > > vAlign > noWrap > width > > > > <TABLE width="100%"><TBODY><TR><TD vAlign="top" noWrap><H3 class="ms- > standardheader">Comments: </H3></TD></TR><><SPAN > id="ctl00_m_g_6dd8f05f_3c51_4cad_9326_440c39aaa8ef_litDisplayComments" > style="DISPLAY: inline-block; WIDTH: 500px"><TR><TD class="ms- > OneMerck_Comments_Formlable" style="PADDING-RIGHT: 4px; PADDING-LEFT: > 4px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px" colSpan="4"><IMG > src="http://one-it.merck.com/_layouts/images/merck_images/ > comment_bubble.jpg<http://one-it.merck.com/_layouts/images/merck_images/%0Acomment_bubble.jpg>" > /> TEST_MSS1: </TD></TR><TR><TD vAlign="top" > noWrap width="400">Comments: This is article is for validating > comments enabling using automation </TD><TD vAlign="top" noWrap > align="right" width="100"><INPUT class="MS_OneMerck_CommentSubmit" > style="TEXT-ALIGN: center" onclick=" location.href='http://one- > it.merck.com/Pages/SIT_TEST_AUTOMATION_CONTENTENABLED_POC.aspx? > DId=234cf2d8-99b7-4c5a-811a-dfc863e11623<http://it.merck.com/Pages/SIT_TEST_AUTOMATION_CONTENTENABLED_POC.aspx?%0ADId=234cf2d8-99b7-4c5a-811a-dfc863e11623>'" > type="button" > value="Delete" /> </TD></TR><TR><TD></TD></TR><TR><TD class="ms- > OneMerck_Comments_DashLine" vAlign="top" noWrap width="100%" > colSpan="4">June 15,2009 08:01AM </TD></TR></SPAN></><TR><TD class="ms- > OneMerck_Comments_Formlable" style="PADDING-RIGHT: 4px; PADDING-LEFT: > 4px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px" colSpan="4"><IMG > src="http://one-it.merck.com/_layouts/images/merck_images/ > comment_bubble.jpg<http://one-it.merck.com/_layouts/images/merck_images/%0Acomment_bubble.jpg>" > /> TEST_MSS1: </TD></TR><TR><TD vAlign="top" > noWrap width="400">Comments: This is article is for validating > comments enabling using automation </TD><TD vAlign="top" noWrap > align="right" width="100"><INPUT class="MS_OneMerck_CommentSubmit" > style="TEXT-ALIGN: center" onclick=" location.href='http://one- > it.merck.com/Pages/SIT_TEST_AUTOMATION_CONTENTENABLED_POC.aspx? > DId=234cf2d8-99b7-4c5a-811a-dfc863e11623<http://it.merck.com/Pages/SIT_TEST_AUTOMATION_CONTENTENABLED_POC.aspx?%0ADId=234cf2d8-99b7-4c5a-811a-dfc863e11623>'" > type="button" > value="Delete" /> </TD></TR><TR><TD></TD></TR><TR><TD class="ms- > OneMerck_Comments_DashLine" vAlign="top" noWrap width="100%" > colSpan="4">June 15,2009 08:01AM </TD></TR><TR></TR><TR><TD id="3000" > style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; > PADDING-TOP: 4px" colSpan="4"><H3 class="ms-standardheader">Add a > Comment:</H3><A name="comments"></A></TD></TD><//TD></ > TR><TR><TD><TEXTAREA class="MS_OneMerck_CommentTextBox" > id="ctl00_m_g_6dd8f05f_3c51_4cad_9326_440c39aaa8ef_txtComments" > style="WIDTH: 500px; HEIGHT: 100px" name="ctl00$m > $g_6dd8f05f_3c51_4cad_9326_440c39aaa8ef$txtComments"></TEXTAREA></TD></ > TR><TR><TD><INPUT class="MS_OneMerck_CommentSubmit" > id="ctl00_m_g_6dd8f05f_3c51_4cad_9326_440c39aaa8ef_btnSubmit" > onclick='javascript:WebForm_DoPostBackWithOptions(new > WebForm_PostBackOptions("ctl00$m$g_6dd8f05f_3c51_4cad_9326_440c39aaa8ef > $btnSubmit", "", true, "CommentSubmit", "", false, false))' > type="submit" name="ctl00$m$g_6dd8f05f_3c51_4cad_9326_440c39aaa8ef > $btnSubmit" value="Submit" /> <SPAN > id="ctl00_m_g_6dd8f05f_3c51_4cad_9326_440c39aaa8ef_rfvRequiredField" > style="VISIBILITY: hidden; COLOR: red" > > controltovalidate="ctl00_m_g_6dd8f05f_3c51_4cad_9326_440c39aaa8ef_txtComments" > errormessage="Please, enter comment." validationGroup="CommentSubmit" > initialvalue="" isvalid>Please, enter comment.</SPAN></TD><TD></TD></ > TR><TR><TD class="ms-linksectionheader" vAlign="middle" width="100%" > ms-standardheader?="">Thank you for your comments.<H3></H3></TD><TD></ > TD></TR></TBODY></TABLE> > > On Jun 15, 3:23 am, Prajakta Jadhav <[email protected]> wrote: > > try this --> > > puts ie.cell(:class,"ms-OneMerckQuickPollMessageDisplayCell").text > > > > Prajakta > > > > > > > > On Mon, Jun 15, 2009 at 12:44 PM, Rahul Ahuja <[email protected]> > wrote: > > > > > But, there is no :id property associated with it. > > > > > Thanks Wesley Chen for your quick response. > > > But, unfortunately the solution shared doesnt seem to work. > > > > > html code is: > > > <TD class="ms-OneMerckQuickPollMessageDisplayCell"> > > > You have already submitted your response. > > > </TD> > > > > > Hence, the only attribute I have to access text is" class". Please > > > suggest how to go ahead with it. > > > > > Thanks, > > > Rahul > > > > > On Jun 15, 3:06 am, Wesley Chen <[email protected]> wrote: > > > > puts ie.cell(:id,...).text > > > > Thanks. > > > > Wesley Chen. > > > > > > On Mon, Jun 15, 2009 at 2:48 PM, Rahul Ahuja <[email protected]> > > > wrote: > > > > > > > I want to compare value of textfield appeared on webpage with > > > > > expected > > > > > output. > > > > > > > for example: > > > > > One my web application; i have a submit button. Wheneven I click > it; > > > > > following message is displayed. > > > > > > > You have already submitted your response. > > > > > > > Following is the html code for it: > > > > > > > <TD class="ms-OneMerckQuickPollMessageDisplayCell"> > > > > > You have already submitted your response. > > > > > </TD> > > > > > > > Please do let me know specific command to capture this. > > > > > > > Thanks in Advance > > > > > Rahul- Hide quoted text - > > > > > > - Show quoted text -- 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 [email protected] Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---
