Why not simply: 

browser.div(:class=>'ui-dialog-content').button(:value =>'Save').
when_present.click



On Thursday, August 7, 2014 10:23:22 AM UTC+3, sudhir ranjan swain wrote:
>
> I want to access different elements in a dialog box which opens after 
> clicking on a button in page.For example i want to check a radio 
> button,entering text ,clicking on button and then close the dialog window.
>
> Below is the code:
>
> div class="ui-dialog-content ui-widget-content" style="width: auto; 
> min-height: 0px; height: 804.267px;"><iframe width="760px" height="800" 
> frameborder="0" 
> src="/apex/PreInstall_Notes?ContractID=800f00000006SVS&LangCode=USE&Order=False&AccountId=001f000000dea7Z">#document<!DOCTYPE
>  
> html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
> http://www.w3.org/TR/html4/loose.dtd";><html><head> … </head><body><form 
> id="j_id0:j_id31" enctype="application/x-www-form-urlencoded" action="
> https://c.cs16.visual.force.com/apex/PreInstall_Notes"; method="post" 
> name="j_id0:j_id31"><input type="hidden" value="j_id0:j_id31" 
> name="j_id0:j_id31"></input><script> … </script><div class="apexp"><div 
> class="individualPalette"><div class="accountBlock"><div 
> id="j_id0:j_id31:thePageBlock" class="bPageBlock brandSecondaryBrd 
> apexDefaultPageBlock secondaryPalette"><div class="pbHeader"> … </div><div 
> class="pbBody"><span id="j_id0:j_id31:thePageBlock:j_id33"></span><div 
> class="tableHead"> … </div><br></br><span 
> id="j_id0:j_id31:thePageBlock:j_id60"><table 
> class="tableCommon"><tbody><tr> … </tr><tr><td class="lblQuestions"> … 
> </td><td> … </td></tr><tr> … </tr><tr> … </tr><tr> … </tr><tr> … </tr><tr> 
> … </tr><tr> … </tr><tr> … </tr><tr> … </tr><tr id="groupDetailSection" 
> style="display: none;"> … </tr><tr> … </tr><tr> … </tr><tr> … </tr><tr> … 
> </tr><tr> … </tr><tr> … </tr><tr> … </tr><tr id="AEProvidedFloorPlan_ERB" 
> style="display: none;"> … </tr><tr> … 
> </tr></tbody></table></span></div><div class="pbBottomButtons"> … 
> </div><div class="pbFooter secondaryPalette"> … 
> </div></div></div></div></div><div 
> id="j_id0:j_id31:j_id327"></div></form><span 
> id="ajax-view-state-page-container" style="display: none"> … </span><script 
> type="text/javascript"> … </script><div id="datePicker" class="datePicker"> 
> … </div></body></html></iframe></div></div><div class="ui-widget-overlay" 
> style="width: 1349px; height: 4172px; z-index: 1001;"></div></body></html>
>
> Below is the html code for a button which i want to click inside that 
> dialog window.Just want to know how to switch to the dialog window and 
> perform on it.
>
>     td id="j_id0:j_id31:thePageBlock:j_id32" class="pbButton "><input 
> id="j_id0:j_id31:thePageBlock:j_id32:btnSave" class="btn" type="submit" 
> value="Save" name="j_id0:j_id31:thePageBlock:j_id32:btnSave"></input><input 
> id="j_id0:j_id31:thePageBlock:j_id32:btnCancel" class="btn" type="submit" 
> onclick="closePopupWindow();" value="Cancel" 
> name="j_id0:j_id31:thePageBlock:j_id32:btnCancel"></input
>
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to