how to handle java script pop ups ??

Discussion in 'Ruby' started by Pradeepta Swain, Feb 4, 2008.

  1. 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/.
     
    Pradeepta Swain, Feb 4, 2008
    #1
    1. Advertising

  2. Pradeepta Swain

    7stud -- Guest

    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/.
     
    7stud --, Feb 4, 2008
    #2
    1. Advertising

  3. Pradeepta Swain

    Ben Weeks Guest

    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 -- <> 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/.
    >
    >
     
    Ben Weeks, Feb 4, 2008
    #3
  4. 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 ??
     
    Manish Sapariya, Feb 5, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Bass
    Replies:
    0
    Views:
    454
    Daniel Bass
    Jul 25, 2003
  2. Joel Barsotti

    validation with alert pop ups

    Joel Barsotti, Aug 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    369
    Steve C. Orr, MCSD
    Aug 8, 2003
  3. keiran

    Modal pop-ups in ASP.

    keiran, Jan 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    353
    =?ISO-8859-1?Q?Anders_Nor=E5s?=
    Jan 28, 2005
  4. Kieran Breen

    pop ups

    Kieran Breen, Feb 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    495
    Kieran Breen
    Feb 7, 2005
  5. Shweta
    Replies:
    0
    Views:
    109
    Shweta
    Mar 11, 2009
Loading...

Share This Page