Hi Vamsi, 

There are a multiple different ways to click the button you are looking for

@browser.button(:name, 'delete').when_present.click
@browser.button(:onclick, "window.location.href = 
'https://ww.mysite.com/plugins/social/profile/delete?sessionKey=52205ce9e4b04782e12a79ec&webSocketIdentifier=52205ce9e4b04782e12a79eb';
 
return false").when_present.click
@browser.button(:style, 'padding: 10px 10px').when_present.click

also the one johnssn mentioned will also work 

@browser.button(:text, /Delete account/).when_present.click

If one method does not work make sure you check 
http://watir.github.io/watir-webdriver/doc/Watir.html


On Friday, 30 August 2013 05:27:23 UTC-6, Vamsi Mandapati wrote:
>
> Here is my snippet 
>  delete_account= @browser.element(:css => "p.actions > 
> button[name:'delete']")
>   delete_account.click
>
>
> and here is my html 
>
> <html><head>
>      
>   <body>
>     <div class="header-wrapper">
>       <div class="header">Update your Profile</div>
>     </div>
>       <form method="post" action="">
>     <input type="hidden" name="_utf8" value="☃">
>           <p>
>       <p class="actions">
>         <input style="float: right" id="submit" type="submit" name="Create 
> account" value="Update profile">
>         <button name="cancel" style="padding: 10px 10px" 
> onclick="window.close(); return false">Cancel</button>
>         <button name="delete" style="padding: 10px 10px" 
> onclick="window.location.href = '
> https://ww.mysite.com/plugins/social/profile/delete?sessionKey=52205ce9e4b04782e12a79ec&amp;webSocketIdentifier=52205ce9e4b04782e12a79eb<https://ww.mysite.com/plugins/social/profile/delete?sessionKey=52205ce9e4b04782e12a79ec&webSocketIdentifier=52205ce9e4b04782e12a79eb>';
>  
> return false">Delete account</button>
>       </p> 
>

-- 
-- 
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/groups/opt_out.

Reply via email to