how to handle java script pop ups ??

  • Thread starter Pradeepta Swain
  • Start date
P

Pradeepta Swain

How can I access java script pop ups using ruby ? I want to access the
alert message as well as click the button of pop up boxes . How can I do
that ? Anybody help ??
 
7

7stud --

Pradeepta said:
How can I access java script pop ups using ruby ? I want to access the
alert message as well as click the button of pop up boxes . How can I do
that ? Anybody help ??

I don't think you can. javascript is part of a software program
variously named: IE, Firefox, Safari, etc. that executes on a user's
computer. It's hard to tell what type of program that you want to use
to control the javascript execution:

1) A program running on the user's computer where the web browser is
executing the javascript
2) a program on a remote server.

With 2), you can't affect something that is executing in the user's
browser. A program on a server can decide what to send to the client
browser, but once the client browser starts executing the javascript,
the javascript program decides what will happen from then on--not your
program on the server.

With 1), I think it is probably possible, but you would have to somehow
use ruby to control how a software program is executing, i.e. the
browser. That would require that your ruby program open communication
with the browser and then use it's API to affect how the browser
executes the javascript. I doubt whether the API provides such fine
grained control like that, and if it did, you would probably have to
study the API for years before you could figure out how to do that.
 
B

Ben Weeks

If you want to do a fair amount of hacking you could try playing
around with ruby-spidermonkey, it's a bunch of ruby bindings for
firefox's javascript interpreter, (code named SpiderMonkey.)

http://code.google.com/p/ruby-spidermonkey/

Aside from that, I've had a hard time finding good support for JS in
ruby. Maybe somebody on the board has had better results?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top