Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > how to handle java script pop ups ??

Reply
Thread Tools

how to handle java script pop ups ??

 
 
Pradeepta Swain
Guest
Posts: n/a
 
      02-04-2008
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 ??
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
7stud --
Guest
Posts: n/a
 
      02-04-2008
Pradeepta Swain wrote:
> 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.






--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Ben Weeks
Guest
Posts: n/a
 
      02-04-2008
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?

On Feb 4, 2008 4:46 PM, 7stud -- <(E-Mail Removed)> wrote:
> Pradeepta Swain wrote:
> > 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.
>
>
>
>
>
>
>
> --
> Posted via http://www.ruby-forum.com/.
>
>


 
Reply With Quote
 
Manish Sapariya
Guest
Posts: n/a
 
      02-05-2008
Hi Pradeep,
I assume you are trying to automate IE or FF browser, if not
please ignore.

If you are I believe this should help you.
http://wiki.openqa.org/display/WTR/Pop+Ups

Regards,
Manish

Excerpts from Pradeepta Swain's message of Mon Feb 04 16:24:21 +0530 2008:
> 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 ??


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
UPS service won't start/no UPS tab in Power Options jdimester Computer Support 6 01-23-2010 03:27 PM
How to handle windows pop ups Shweta Ruby 0 03-11-2009 07:33 AM
pop up prevention problem; for wanted pop ups joe doe Firefox 2 03-03-2005 08:08 AM
Pop-ups, spyware, and the like PopUlist349@hotmail.com Firefox 3 12-30-2004 12:06 AM



Advertisments