Store function output to string?

R

reed.adam

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"
 
R

reed.adam

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.
 

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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top