Login web page using mechanize

For button click on your page example this is correct way to click it:
find(:xpath, “//*[@id=“sImage1”]”).click

2012/11/9 john smith [email protected]

ive been trying to look up xpath and css selectors. i have my program
fill out the email and all i need to figure out now is to press the send
button. but its not like the other buttons i have used.

 
   
    <tr><td colspan="3">&nbsp;</td></tr>
    <tr>
      <td width="0%">&nbsp;</td>
      <td width="0%">
  <a 

href=“javascript:exit(’/online/valdoc/ea_askaqsend?__i=1352473481343-4376714975339252553’)”> 
<!–

-->

that is the code from the pages source file. this is the send button i
need to click. but it says cannot find button or link with value send.
so i started looking into href, xpath, and css tried like 100 different
things and still no dice. any suggestions? what kind of button is it
would probably help a lot? i dont know how to tell if its css or xpath.

GOT IT!!!

find(:xpath, “//[@class=‘CLiKStdleft’]").click
find(:xpath, "//
[@src=’/01/images/pg3_but2_new.gif’]”).click

theres the missing code! feels good now that it works though. thank you
for all your help!

find(:xpath, “//*[@class=‘CLiKStdleft’]”).click

It could be written with CSS selectors:
find(:css, “.CLiKStdleft”).click
or shorter (since CSS is default selector in Capybara):
find(“CLiKStdleft”).click

“Иван Бишевац” [email protected] wrote in post #1083769:

For button click on your page example this is correct way to click it:
find(:xpath, “//*[@id=“sImage1”]”).click

2012/11/9 john smith [email protected]

“id=sImage1” is the button to log into the webpage. i have already
gotten past that to the email page, it fills out all the fields and all
i need to do is click the send button on the email page. but when i look
at it with firebug its completely different than the log on button. i
put the code in my previous response for the new button.