I know.  Sorry.

Here is what I am trying to accomplish.

Our app has communities that professional members belong to so they
can communicate with one an other.

Within these communities there are tabs and the community could have 2 to 5
or even more showing.  My test is to click on each one of them and make sure
the user lands on the intended page.  What I have done so far is retrieved
the tab names from html list they are in.  I have this hole process in a 'do
loop' though when the script completes the first tab but blows up when it
moves on to the next one.  I feel if I put the array into a string then use
the split method in Ruby I might be able to do a better job of control the
outcome.  I am a long time QTP developer so WATIR, ruby are very new to me.
I have always used for...next statements in VBScript because I feel I can do
a better job of control the script.

I hope this helps.

Thank you,
Joe
On Thu, Oct 20, 2011 at 4:49 PM, Chuck van der Linden <[email protected]>wrote:

> um, you want to take something that is basically an array, cram it all
> into a comma separated string so you can use split to put it back into
> an array again?
>
> I'm really confused why you want to do things that way
>
> Perhaps if you were to explain exactly what it is that you are trying
> to accomplish (at a slightly higher level) we could suggest a best
> approach
>
> it is sort of a 'ruby language' type question, but since it's in the
> context of dealing with select list options and values,  the answer is
> likely to be of value to the group.
>
> On Oct 20, 10:28 am, Joe Fl <[email protected]> wrote:
> > How can take those values from the list and put them in a string so I
> > can use the split method?
> >
> > the values from the list box are
> > ACG GI Circle
> > Advisory Board CDK Sandbox
> > Advisory Board Sandbox
> > AFCC
> > Akron Children's Hospital
> > Bayer Pulmonary Hypertension Community
> > Better Health Greater Cleveland
> > Board of Governors
> > Case Western Reserve University - School of Medicine Alumni
> > CHB Demo
> > Children's Hospital Boston
> > Children's Hospital Boston Alumni Association Satellite Community
> > Children's Hospital Boston PPOC Online Community
> > Covance Virtual Advisory Board
> > Future Forum
> > Future Forum Editorial Board
> > GI Consultant Forum
> > Janssen Advisory Board Forum
> > Medical Affairs Leaders Forum
> > NAPH Member Community
> >
> > I want to place them in a string called com_list with a comma between
> > each value.
> >
> > I currently retrieve them by above code but it would a lot easier to
> > work with them in a string.
> >
> > Thank you,
> > Joe
> >
> > On Oct 19, 3:17 pm, Chuck van der Linden <[email protected]> wrote:
> >
> >
> >
> >
> >
> >
> >
> > > On Oct 19, 11:14 am, Joe Fl <[email protected]> wrote:
> >
> > > > Hi,
> >
> > > > I have figure it out.
> >
> > > > Code...
> > > > names = $browser.select_list(:name,'communities').options
> >
> > > > community_names_arr = Array.new
> >
> > > > commuName = ""
> >
> > > > name_number = 0
> >
> > > > names.each do |name|
> >
> > > >   puts commuName = "#{name_number}: #{name.text}"
> >
> > > >   name_number = name_number + 1
> >
> > > > end
> >
> > > > this gives me the text to each option in the listbox.
> >
> > > You might want to make use of .each_with_index to make your code a
> > > little easier and cleaner
> >
> > > names = $browser.select_list(:name,'communities').options
> >
> > > community_names_arr = Array.new
> >
> > > commuName = ""
> >
> > > names.each_with_index do |name, i|
> >
> > >   puts commuName = "#{i}: #{name.text}"
> >
> > > end
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> [email protected]
> http://groups.google.com/group/watir-general
> [email protected]<http://groups.google.com/group/[email protected]>
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to