Prev: Online Math Coding Contest
Next: openssl error - ubuntu
From: Go Ma on 6 Jan 2010 08:51 I am newbie to Ruby so pl pardon my ignorance. I have an image in a web page which has the following code: <img style = "cursor: hand", onclick="javascript:fnC20WebCtrlOpenCtrlChangeProjectWindow(this,event,3,0,'1022',''); Can someone please suggest how to click this image (basically, invoke the javascript) using Ruby?? Tried searching the net but hadn't had much luck. -- Posted via http://www.ruby-forum.com/.
From: Brian Candler on 6 Jan 2010 10:39 Go Ma wrote: > I am newbie to Ruby so pl pardon my ignorance. > > I have an image in a web page which has the following code: > > <img style = "cursor: hand", > onclick="javascript:fnC20WebCtrlOpenCtrlChangeProjectWindow(this,event,3,0,'1022',''); > > Can someone please suggest how to click this image (basically, invoke > the javascript) using Ruby?? Tried searching the net but hadn't had much > luck. If you want to control a browser programatically using Ruby, have a look at Watir: http://watir.com/ Another option is Selenium. -- Posted via http://www.ruby-forum.com/.
From: Go Ma on 6 Jan 2010 11:33 Hi Brian, Thanks a lot for your prompt note. I actually started off with Watir, but got stuck with the above issue. I am attaching the relevant code I could view using IEDev bar. Any help would be appreciated!! cheers, GM Attachments: http://www.ruby-forum.com/attachment/4357/screenshot.docx -- Posted via http://www.ruby-forum.com/.
From: David Masover on 6 Jan 2010 14:33 On Wednesday 06 January 2010 10:33:47 am Go Ma wrote: > I am attaching the relevant code I > could view using IEDev bar. Wait, why are you attaching this as a screenshot? Shouldn't you be able to just provide source, as text? Or better yet, a URL to the page in question? Better still, give us a simplified example -- a small HTML page that does nothing other than demonstrate the problem. http://www.catb.org/~esr/faqs/smart-questions.html#volume > http://www.ruby-forum.com/attachment/4357/screenshot.docx Screenshot... docx. You do realize those don't go together, don't you? If it's an image, attach an image -- png, jpeg, even bmp would work. Not all of us have (or want) MS Word. http://www.catb.org/~esr/faqs/smart-questions.html#formats
From: Brian Candler on 6 Jan 2010 16:48 Go Ma wrote: > Thanks a lot for your prompt note. I actually started off with Watir, > but got stuck with the above issue. Then your question should be: "in Watir, how do I click on an image that has a javascript onclick handler?" That question would be best directed to a Watir forum. I also suggest that you will get a better answer there if you post the ruby code that you already tried but failed. Also show what relevant items you found in the Watir documentation and/or source code and/or from googling, and why it didn't help you solve the problem. > I am attaching the relevant code I > could view using IEDev bar. Any help would be appreciated!! You didn't paste any code (Ruby or JS) whatsoever. You pasted a document containing a screenshot of some HTML. I *was* able to open that docx file with OpenOffice, but you should be aware that if you make life difficult for the people you are asking for help, then they're not going to be inclined to. However, I am not a Watir expert anyway, so the best I can offer is to try again in a Watir forum. -- Posted via http://www.ruby-forum.com/.
|
Pages: 1 Prev: Online Math Coding Contest Next: openssl error - ubuntu |