Store function output to string?

Discussion in 'Ruby' started by reed.adam@gmail.com, Jul 24, 2006.

  1. Guest

    I am looking for a way to store a function's output to a string.
    Believe it or not, I've had some trouble finding this using google.

    I have a function for web testing (WET) that displays the text in an IE
    pop-up:

    $ie.Dialog("title:Window Title").text()

    This successfully prints the text of the pop-up in IRB. However, in
    order to validate this text, I want to capture it to a string, and then
    use a series of other strings to check it out.

    How would I go about doing this?

    Thanks.

    irb(main):011:0> ie.Dialog.text()
    => "There are problems with some of the form values:\n\n - email
    address is mi
    ssing.\n - your first and last names are required.\n - you must
    enter a comp
    any name.\n - you must enter a property name.\n - phone number is
    required.\
    n"
    , Jul 24, 2006
    #1
    1. Advertising

  2. Guest

    Nevermind, got it.

    alert = $ie.Dialog("title:Window").text().to_s

    So that's how it works to store the output of a command rather than the
    command itself.



    wrote:
    > I am looking for a way to store a function's output to a string.
    > Believe it or not, I've had some trouble finding this using google.
    >
    > I have a function for web testing (WET) that displays the text in an IE
    > pop-up:
    >
    > $ie.Dialog("title:Window Title").text()
    >
    > This successfully prints the text of the pop-up in IRB. However, in
    > order to validate this text, I want to capture it to a string, and then
    > use a series of other strings to check it out.
    >
    > How would I go about doing this?
    >
    > Thanks.
    >
    > irb(main):011:0> ie.Dialog.text()
    > => "There are problems with some of the form values:\n\n - email
    > address is mi
    > ssing.\n - your first and last names are required.\n - you must
    > enter a comp
    > any name.\n - you must enter a property name.\n - phone number is
    > required.\
    > n"
    , Jul 24, 2006
    #2
    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. =?Utf-8?B?UnVkeQ==?=

    to store or not to store an image

    =?Utf-8?B?UnVkeQ==?=, Mar 29, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    613
    =?Utf-8?B?UnVkeQ==?=
    Mar 30, 2005
  2. DC
    Replies:
    2
    Views:
    1,246
  3. Jeff Rodriguez
    Replies:
    0
    Views:
    526
    Jeff Rodriguez
    Jul 11, 2006
  4. Replies:
    2
    Views:
    268
    tuxlover
    Jul 11, 2005
  5. =?Utf-8?B?YzY3NjIyOA==?=

    fetch data from output parameter of a store procedure

    =?Utf-8?B?YzY3NjIyOA==?=, Aug 29, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    2,303
    Steven Cheng[MSFT]
    Aug 31, 2006
Loading...

Share This Page