[wtr-general] Re: Weird timing behavior when using assert(object.exists?) when widgets exist.

2009-05-13 Thread Moochie

The issue I was having had to do with an error on the page within one
of the widgets.

It was a struts error (whatever that is)

Once I removed that widget, it ran without hanging.



On May 7, 4:33 pm, "Darin Duphorn" 
wrote:
> Have you been to igoogle?  Those information boxes are widgets.
>
> The html is basically Div(:id,widget_blah), but when a page open they
> use ajax to load the information on the widgets separately from the rest
> of the page.
>
> As for button_id is the a variable I use for a button button_id =
> $ie.button(:text,"blah")
>
> I think I might have figured out a solution.
>
> Thanks for the reply
>
> 
>
> From: watir-general@googlegroups.com
> [mailto:watir-gene...@googlegroups.com] On Behalf Of Charley Baker
> Sent: Thursday, May 07, 2009 3:17 PM
> To: watir-general@googlegroups.com
> Subject: [wtr-general] Re: Weird timing behavior when using
> assert(object.exists?) when widgets exist.
>
> What's a widget? My search on Wikipedia turns up 
> this:http://en.wikipedia.org/wiki/Widget. I also have no clue as to what
> button_id or object_id are - though I can take guess, but it's custom
> code. Simplify and post some real live code for your stuff and the html
> for the app.
>
> Charley Baker
> blog:http://blog.charleybaker.org/
> Lead Developer, Watir,http://wtr.rubyforge.org
> QA Architect, Gap Inc Direct
>
> On Thu, May 7, 2009 at 1:53 PM, Moochie 
> wrote:
>
> When I open a page that has widgets it hangs on assert(object.exists?)
>
> I've tried.
>
> Added a long wait to make sure the page is fully loaded.  Which did
> nothing.
>
> I've minimized the page - "which worked"
>
> When it's running, and it starts to hang, I open another browser/or
> click different page ot tab and it no longer hangs.
>
> I've put timers in and realized it freezes on the follow:
>
> assert(object_id.exists?) #Any object
>
> if button_id == nil
>
> I opened in Firefox and the page doesn't display errors when using
> Firebug. I'm actually testing using IE 7.0.
>
> Has anyone run into this or does anyone have a suggestions?
>
> Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Wildcards

2009-05-08 Thread Moochie

If I have a cell with the following (05-07-2009 09:00 AM)) and I only
want to validate the Date and AM or PM, we use wildcards to represent
the data we doen't want to compare.  Using the following function.

excel_value = 05-07-2009 * AM
object_text = 05-07-2009 09:00 AM

def format_object_text_when_wildcards_exist(excel_value,object_text)
  wildcard_str = ""
  index = 1
  excel_value.to_s.each_char {|x|
if x == '*'
  wildcard_str = wildcard_str+","+
index.to_s
end
index = index + 1
  }
  #Remove first chacter and splits string
  wildcard_str = wildcard_str[1..-1].split(',')
  #Replace wild cards from the object text
  index = 1
  z = 0
  value = ""
  object_text.to_s.each_char {|y|
if index == wildcard_str[z].to_i
  value = value + "*"
  z = z +1
else
  value = value + y
end
index = index + 1
  }
  return value
end

#Call the function
cell_value = format_object_text_when_wildcards_exist
(excel_value,object_text)

if cell_value = excel_value
  puts "Pass"
else
  puts "Fail"
end

Is there a better way to do this? or a method that uses less lines of
code, please post.

Thanks,


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Weird timing behavior when using assert(object.exists?) when widgets exist.

2009-05-07 Thread Moochie

When I open a page that has widgets it hangs on assert(object.exists?)

I've tried.

Added a long wait to make sure the page is fully loaded.  Which did
nothing.

I've minimized the page - "which worked"

When it's running, and it starts to hang, I open another browser/or
click different page ot tab and it no longer hangs.

I've put timers in and realized it freezes on the follow:

assert(object_id.exists?) #Any object


if button_id == nil

I opened in Firefox and the page doesn't display errors when using
Firebug. I'm actually testing using IE 7.0.

Has anyone run into this or does anyone have a suggestions?

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Does Watir 1.6.2 install on Mac OS X?

2009-04-26 Thread Moochie

when I run this:

 sudo gem install safariwatir

I get this?

Building native extensions.  This could take a while...
ERROR:  Error installing safariwatir:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb
can't find header files for ruby.


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rb-
appscript-0.5.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/rb-appscript-0.5.1/
gem_make.out

Any ideas?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: What editor should I use for mac?

2009-04-23 Thread Moochie

Any chance the have this written for Macs?

I'm mac challenged!

On Apr 22, 10:42 am, Jeff Fry  wrote:
> There isn't a separate ruby version of Eclipse, though you'll want to
> install the ruby plug-in. See the Watir wiki page on 
> Eclipse:http://wiki.openqa.org/display/WTR/Setting+up+Eclipse+for+Ruby
>
>
>
> On Wed, Apr 22, 2009 at 8:32 AM, Hassan Malik  wrote:
> > I am curently SciTe on windows and wold like to try Eclipse. Does it matter
> > what version I use? They have Eclipse IDE for Java, C/C++, but I don't see
> > one for ruby.http://www.eclipse.org/downloads/
>
> >  --
> > *From:* Lisa Crispin 
> > *To:* watir-general@googlegroups.com
> > *Sent:* Tuesday, April 21, 2009 5:26:31 PM
> > *Subject:* [wtr-general] Re: What editor should I use for mac?
>
> > I confess I don't use Watir much on my mac yet - it's on my list to someday
> > get the scripts running in Firewatir. But I just use Eclipse to edit my
> > Watir scripts on either box. Works well.
> > -- Lisa
>
> > On Tue, Apr 21, 2009 at 3:14 PM, Moochie wrote:
>
> >> I was just give a mac and I've attempted to get watir working on it,
> >> but it said I couldn't save a file as .rb I could only save it
> >> as .rtb.
>
> >> Also, should I install ubuntu?
>
> > --
> > Lisa Crispin
> > Co-author with Janet Gregory, _Agile Testing: A Practical Guide for Testers
> > and Agile Teams_ (Addison-Wesley 2009)
> >http://lisacrispin.com
>
> --
> Jeff Fry
>
> http://testingjeff.wordpress.comhttp://associationforsoftwaretesting.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] What editor should I use for mac?

2009-04-21 Thread Moochie

I was just give a mac and I've attempted to get watir working on it,
but it said I couldn't save a file as .rb I could only save it
as .rtb.

Also, should I install ubuntu?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: firewatir and jssh

2009-04-14 Thread Moochie

#open first occurance of FF
$ie = Firefox.new :attach => true
#Navigate it to cnn.com
$ie.goto "cnn.com"
#This now works (Doesn't Hang)
system("C:\\Program Files\\Mozilla Firefox\\firefox.exe -
jssh")
#This still fails
$ie = FireWatir::Firefox.attach(:title,"Google")
puts $ie.title

Any suggestions?



On Apr 13, 3:21 pm, bwaybandit  wrote:
> also on XP/SP2
>
> On Apr 13, 3:55 pm, bwaybandit  wrote:
>
>
>
> > ff - 3.0.5
> > jssh - 0.9
>
> > On Apr 13, 3:31 pm, "Darin Duphorn" 
> > wrote:
>
> > > What version of FF are you using?
>
> > > Even if I run from irb using system or exec it hangs.
>
> > > -Original Message-
> > > From: watir-general@googlegroups.com 
> > > [mailto:watir-gene...@googlegroups.com] On Behalf Of bwaybandit
> > > Sent: Monday, April 13, 2009 12:42 PM
> > > To: Watir General
> > > Subject: [wtr-general] Re: firewatir and jssh
>
> > > system("C:\\Program Files\\MozillaFirefox\\firefox.exe -jssh"). that
> > > works for me. If that is not working for you, you might want to try
> > > exec BUT having said that, watch out because exec overwrites the
> > > existing process, so if you are calling it from another process, your
> > > originial process will hang.
>
> > > all my test machines are set up using a perl script and one of the
> > > setup processes launches FF. The system command I tried above was from
> > > irb and it came back and nothing hung.
>
> > > On Apr 13, 12:31 pm, "Darin Duphorn" 
> > > wrote:
> > > > Actually, when I try to run it for the systems it hangs.
>
> > > > How are you launching the jssh?
>
> > > > -Original Message-
> > > > From: watir-general@googlegroups.com 
> > > > [mailto:watir-gene...@googlegroups.com] On Behalf Of bwaybandit
> > > > Sent: Monday, April 13, 2009 11:18 AM
> > > > To: Watir General
> > > > Subject: [wtr-general] Re: firewatir and jssh
>
> > > > If you use the system command and launchfirefoxlike that, that will
> > > > load jssh
>
> > > > Now that you have jssh in memory, you need to launch the page you want
> > > > toattachto.
>
> > > > require 'watir'
> > > > Watir.options[:browser]='firefox'
> > > > ff=Watir::Browser.new
> > > > ff.goto 'http://www.google.com'
>
> > > > (You already have a reference to the page in 'ff')
>
> > > > If you want another reference to the same page, you would say:
> > > > ff1=ff.attach(:title, /something in the title/)
>
> > > > Now you have a second reference to the page...
>
> > > > On Apr 13, 11:30 am, "Darin Duphorn" 
> > > > wrote:
> > > > > How do dou start Jssh?
>
> > > > > I've tried the below, but theattachstill fails.
>
> > > > > system('C:\Program Files\MozillaFirefox\firefox.exe -jssh')        
>
> > > > > $ie = FireWatir::Firefox.attach(:title,"Google")
>
> > > > > Thanks,
>
> > > > > 
>
> > > > > From: watir-general@googlegroups.com
> > > > > [mailto:watir-gene...@googlegroups.com] On Behalf Of Angrez Singh
> > > > > Sent: Monday, April 13, 2009 5:55 AM
> > > > > To: watir-general@googlegroups.com
> > > > > Subject: [wtr-general] Re: firewatir and jssh
>
> > > > > I tried the following code with Firewatir 1.6.2 and it worked for me.
>
> > > > > require 'firewatir'
>
> > > > > ff = FireWatir::Firefox.attach(:title,"Google")
>
> > > > > puts ff.html
> > > > > ff.close
>
> > > > > - Angrez
>
> > > > > On Mon, Apr 13, 2009 at 1:31 PM, George 
> > > > > wrote:
>
> > > > > It was my understanding that theattachmethod doesn't work with FF,
> > > > > only with IE.  Can you confirm this?
>
> > > > > On Apr 13, 12:07 am, Angrez Singh  wrote:
>
> > > > > > For attaching to an existingFirefoxinstance you can use
> > > > > > FireWatir::Firefox.attach() method. But you need to make sure the 
> > > > > > JSSh
> > > > > is
> > > > > > running in the existing instance.
>
> > > > > > Regarding XPath i'll look into it & get back to you.
>
> > > > > > - Angrez
>
> > > > > > On Fri, Apr 10, 2009 at 8:42 PM, Jeremy Mordkoff 
> > > > > wrote:
> > > > > > >  Okay, I answered some of my own questions. I stumbled on the RDOC
> > > > > > > browser, found js_eval and I started munging it.
>
> > > > > > > In firebug, I can do
>
> > > > > > > var results = document.evaluate("//*[name()='vgtile' and
> > > > > @label='Hulu']",
> > > > > > > document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
>
> > > > > > > if (results.snapshotLength >=
> > > > > > > 1)
>
> > > > > > > {
>
> > > > > > >     results.snapshotItem(0).oncommand();
>
> > > > > > > }
>
> > > > > > > console.log("done")
>
> > > > > > > and it works every time. But in firewatir, if I do
>
> > > > > > > xpath="//*[name()='vgtile' and @label='Hulu']"
>
> > > > > > > query = "browser=window.getBrowser();
>
> > > > > document.evaluate(\"#{xpath}\",
>
> > > > > > > document, null, 7, null).snapshotLength;"
>
> > > > > > > ff.js_eval(query)
>
> > > > > > > I get zero every time. Any ideas?  Is there a jssh forum?
>
> > > > > > > PS. The 7 is the value of XPathResult.ORDERED_NODE_SNAPSHOT_TYPE
> > > > > since
> > > > > > 

[wtr-general] Re: Firefox: Unable to set listbox that exist in a thickbox\modal

2009-04-10 Thread Moochie

I was finally able to set the listbox using value

listbox_id.value = '1'

So I'm going to have to uses DB query and get the value from the
database using the text, then set the listbox.




On Apr 10, 11:57 am, Moochie  wrote:
> puts listbox_id
> #
>
> I'm guesing it's finding it, but it just doesn't set it.
>
> On Apr 10, 11:10 am, "Darin Duphorn" 
> wrote:
>
>
>
> > I saw this, but I'm not getting that error.
>
> >http://jira.openqa.org/browse/WTR-271
>
> > I'm just unable to populate the listbox.
>
> > Is it because of the modal/thickbox?
>
> > -Original Message-
> > From: watir-general@googlegroups.com
>
> > [mailto:watir-gene...@googlegroups.com] On Behalf Of Moochie
> > Sent: Friday, April 10, 2009 11:05 AM
> > To: Watir General
> > Subject: [wtr-general] Firefox: Unable to set listbox that exist in a
> > thickbox\modal
>
> > I'm using listbox_id.set(excel_value.to_s)
>
> > And it just doesn't seem to populate the listboxs in the modal.
>
> > Has anyone else seen this?
>
> > Thanks,
>
> > Darin- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Firefox: Unable to set listbox that exist in a thickbox\modal

2009-04-10 Thread Moochie

puts listbox_id
#

I'm guesing it's finding it, but it just doesn't set it.



On Apr 10, 11:10 am, "Darin Duphorn" 
wrote:
> I saw this, but I'm not getting that error.
>
> http://jira.openqa.org/browse/WTR-271
>
> I'm just unable to populate the listbox.
>
> Is it because of the modal/thickbox?
>
>
>
> -Original Message-
> From: watir-general@googlegroups.com
>
> [mailto:watir-gene...@googlegroups.com] On Behalf Of Moochie
> Sent: Friday, April 10, 2009 11:05 AM
> To: Watir General
> Subject: [wtr-general] Firefox: Unable to set listbox that exist in a
> thickbox\modal
>
> I'm using listbox_id.set(excel_value.to_s)
>
> And it just doesn't seem to populate the listboxs in the modal.
>
> Has anyone else seen this?
>
> Thanks,
>
> Darin- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Firefox: Unable to set listbox that exist in a thickbox\modal

2009-04-10 Thread Moochie

I'm using listbox_id.set(excel_value.to_s)

And it just doesn't seem to populate the listboxs in the modal.

Has anyone else seen this?

Thanks,

Darin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: FireWatir 1.6.2 unittests don't run

2009-04-09 Thread Moochie

Paul,

Did you ever update the wiki?  I'm not finding you direction sto get
passed this issue, and since I'm hitting the issue, and believe others
will.  It would be nice to help other so the will not get a
frustrated.

Many thanks,

Darin

On Apr 7, 12:14 am, Paul Carvalho  wrote:
> I opened Jira ticket #WTR-301 to address the problem.  I'll look over
> the wiki information again and see what I can do to help clarify the
> steps to get up and running until the problem is addressed in a future
> gem release/install.  The present wiki information seems to be really
> geared towards developers, which is a big turn-off for me. ;)
>
> Cheers.  Paul C.
>
> (BTW, I apologised to Al off-list for my prior post.  I didn't mean to
> harsh on him.. I was just frustrated at the time I spent trying to
> resolve the problem when the only advice I could find on the wiki said
> that I need to "Get the source code and unit tests from SVN."  To me,
> asking a tester to install development tools to retrieve development
> source to make something work just seems like the wrong way to go, you
> know?  Ah well, such is life sometimes in the Open Source world. ;)
> Keep moving forward.)
>
> On Apr 6, 11:27 am, Bret Pettichord  wrote:
>
> > Paul,
>
> > Could you update the wiki with this information please?
>
> > Bret
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Segmentation fault 2

2009-03-30 Thread Moochie

I've just installed 1.8.6 and on a new machine and I'm getting the
[BUG] Segmentation fault.

ruby 1.8.6 <2007-09024> [i386-mswin32]

Has anyone figure out what caused this yet?

I looked at other thread and they didn't help.

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] How do you recommend working with table THEAD or TFOOT?

2009-03-13 Thread Moochie

TBODY works nice
table_id.body

How could I create
THEAD
table.head

TFOOT
table.head

I looked for it in table.rb, I was going to see what it took to mimic
table_id.body, but I could even find that.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Get Row Number using cell information

2009-03-11 Thread Moochie

Is there a way to get the row number when you know where the cell is?

$ie.cell(:text=>'blah',:index=>2).rownbr?

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Comparing Tag Text when a Exists

2009-03-04 Thread Moochie

html

   #text   - 123 fake street
   
   #text - Crookston, MN 56716

>From Excell
text = 123 fake street
  Crookston, MN 56716

$ie.p(:text=>text,:index=>index).exists?
  puts "Pass"
else
  puts "Failed"  - Makes it here.
end

So I had the function insert the text into excel using: to see what
the text actually looks like with  tages
ts_worksheet.range($results+$ts_row_nbr.to_s).Value =$ie.p
(:index=>1).text

It displayed the text Like
123 Fake Street 
Crookston, MN 56716 

If I copy that excel cell to the required cell the excel spread sheet
and run the test again it will pass.

The squares in the above were created using Expanded Ascii, but they
don't work when I manually add them in excel cell, so tell the maual
testers to use that when they see a  take will not work.

Does anyone know a way to handle this?

I was thinking maybe using wild cards excel
123 Fake Street*
Crookston, MN 56716*

So everytime I see a * i use .gsub('*',/\.*/) but this will doesn't
work because I cannot convert a regular expression into a string.

Or I could create a function that formats the text to look like.
$ie.p(:text=>/\123 Fake Street/.*/Crookston, MN
56716,:index=>index).exists?

Can anyone help with a soluction to this?

Thanks,

Darin








--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: slice question

2009-02-27 Thread Moochie

#0|0|0|3# - #0|0|1|3

excel_value.to_s.slice(/#.*#/)

Gives me this
#0|0|0|3# - #0|0|1|3

how do I get rid of the "-"?

I've tried and a few others

puts excel_value.to_s.slice(/#.*|.*|.*|.*#/)

Gives me this
#0|0|0|3# - #0|0|1|3

I'm trying to include the '|' bars in the slice

Thanks






On Feb 25, 9:43 am, "Darin Duphorn" 
wrote:
> That worked
>
> Thanks
>
> Darin
>
>
>
> -Original Message-
> From: watir-general@googlegroups.com
>
> [mailto:watir-gene...@googlegroups.com] On Behalf Of Ravi
> Sent: Wednesday, February 25, 2009 9:39 AM
> To: Watir General
> Subject: [wtr-general] Re: slice question
>
> .slice(/\*.*\*/)
>
> On Feb 25, 9:30 am, Moochie  wrote:
> > I want to slice around tow *   *, but the following doesn't work.
>
> > .slice(/*.**/)
>
> > I belive it because of the two * next to each other.  Is thier a way I
> > can make this work?
>
> > Thanks,
>
> > Darin- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] slice question

2009-02-25 Thread Moochie

I want to slice around tow *   *, but the following doesn't work.

.slice(/*.**/)

I belive it because of the two * next to each other.  Is thier a way I
can make this work?

Thanks,

Darin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Issue converting strings

2009-02-25 Thread Moochie

Still cannot figure this one out.


On Feb 20, 1:39 pm, Moochie  wrote:
> I'm writing code to be able to mask out a portion of the strings.
>
> excel_value = testops on 02/19/2009*
>
> if excel_value.index("*") != nill  #Equals 21
>   puts excel_value
>   puts excel_value[0,excel_value.index("*").to_i].to_s.strip
>   puts label_id.document.lastChild.nodeValue.to_s.strip
>   puts label_id.document.lastChild.nodeValue[0,excel_value.index
> ("*").to_i].to_s.strip
> end
>
> results
> testops on 02/19/2009*
> testops on 02/19/2009
> testops on 02/19/2009 10:44
> testops on 02/19/200
>
> Question why did the last statement not display the 9?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: "msvcr80-ruby18.dll was not found" error troubles

2009-02-23 Thread Moochie

I'm getting this same error.

I'm also unable to  gems update because I get the following.

Error Failed to build gem native extension

rake blah blah blah

Gem::manage_gems is deprecated and will be removed on or after March
2009

I've search around to fix this, but I'm unable to.

if key in upgrade gems

message upgrad is not recognized.

What does upgrading have to be so difficult.


On Feb 22, 8:21 pm, marekj  wrote:
> Just to throw 2 cents.
> After installing Ruby I always upgrade gems first before installing
> any other gems.
> The 1.8.6 of ruby comes with gems version 0.9.2. I update gems first
> to 1.3.1 and then install watir 1.6.2 and above.
> This migration on 6 machines so far from Ruby 1.8.5 has worked ok for me.
> and thanks for the write up on the these obscure dependencies.
>
> marekj
>
> Watirloo: Semantic Page Objects in UseCases
> Human Readable Machine Executable Acceptance 
> Testinghttp://github.com/marekj/watirloo/
>
>
>
> On Sat, Feb 21, 2009 at 12:00 PM, Charley Baker  
> wrote:
> > Hey Jeff et al,
>
> >    Thanks for sending the mail. I immediately saw what I glossed over when
> > we were chatting, it is in fact the problem I suspected with a gem that was
> > compiled with Visual Studio 2005 - namely win32-api. For the past two
> > releases - 1.3.0 and 1.4.0, there are 3 versions of the win32-api gem:
> > win32-api-1.4.0-x86-mswin32-80.gem
> > win32-api-1.4.0-x86-mswin32-60.gem
> > win32-api-1.4.0.gem
>
> > Rubygems makes the best guess for your platform when installing gems, the
> > gems above should rely on your ruby environment to pick the right one,
> > the first is for systems that match the environment set in the gem metadata:
> > x86-mswin32-80 - windows Ruby compiled with VS2005 (the msvc runtime version
> > 8),
> > the second one should match the normal Windows one click installer version
> > of Ruby compiled with MSVC6,
> > and the third would be installed on systems where you'd compile the shared
> > libraries for the gem on your system.
>
> > I didn't realize there are now multiple versions of the gem. There's been
> > some development using VS2005 or minGW to compile 1.9.1 for the next One
> > Click Installer to replace the over 10 year old, hard to find MSVC6 compiler
> > to create the c extensions and libraries used by ruby and other gems. I'd
> > assume this new gem 80 is for some of that work.
>
> >  I'mnotquite sure why Rubygems is installing this particular version in
> > some cases, if anyone is still having the issue or can reproduce it, let me
> > know. You can force gems to install the right version, but I'm also curious
> > to see why this is happening.
> > gem install win32-api --platform x86-mswin32-60
>
> > Thanks,
>
> > Charley Baker
> > blog:http://charleybakersblog.blogspot.com/
> > Lead Developer, Watir,http://wtr.rubyforge.org
> > QA Architect, Gap Inc Direct
>
> > On Fri, Feb 20, 2009 at 7:27 PM, Jeff Fry  wrote:
>
> >> Al: Yeah, I was referencing that thread above. It pointed toward Visual
> >> Studio, which I don't have. Charley theorized off list that one of the gems
> >> on my system might have been compiled using Visual Studio.
> >> Bret: Doh. Typo, but the first error ("msvcr80-ruby18.dllwasnot
> >>found") was occuring when I did anything watir-related, including valid
> >> things like running tests that used to work or doing
> >> irb(main):002:0> Watir::IE::VERSION
>
> >> That said, I just uninstalled and reinstalled ruby 1.8.5 > 1.8.6, and then
> >> reinstalled watir...and all seems to be working for me now.
> >> Thanks!
> >> Jeff
>
> >> On Fri, Feb 20, 2009 at 6:10 PM, Bret Pettichord 
> >> wrote:
>
> >>> Jeff Fry wrote:
>
> >>> > irb(main):003:0> Watir::IE::BROWSER
> >>> > NameError: uninitialized constant Watir::IE::BROWSER
> >>> >         from (irb):3
> >>> This is correct, and what I get too.
>
> >>> There is no such thing as Watir::IE:BROWSER.
>
> >>> Bret
>
> >> --
> >> Jeff Fry
>
> >>http://testingjeff.wordpress.com
> >>http://associationforsoftwaretesting.org- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Installing Watir

2009-02-23 Thread Moochie

Why doesn't it automatically update your system setting when
installing ruby?

I have to always repeat the following everytime I upgrade to a newer
version before I can run gem Install watir.

Goto Setting ->Control Panel-> System
Click Advanced Tab
Click Environment Variables
Under Path Variable verify C:\Ruby\bin Exists.  If not add it.
Under PATHEXT Variable verify .RB exists.  If not add it
If variable RUBYOPT Doesn't Exist add it
RUBYOPT - Value = -rubygems

Thanks,


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Issue converting strings

2009-02-20 Thread Moochie

I'm writing code to be able to mask out a portion of the strings.

excel_value = testops on 02/19/2009*

if excel_value.index("*") != nill  #Equals 21
  puts excel_value
  puts excel_value[0,excel_value.index("*").to_i].to_s.strip
  puts label_id.document.lastChild.nodeValue.to_s.strip
  puts label_id.document.lastChild.nodeValue[0,excel_value.index
("*").to_i].to_s.strip
end

results
testops on 02/19/2009*
testops on 02/19/2009
testops on 02/19/2009 10:44
testops on 02/19/200

Question why did the last statement not display the 9?





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] table.each fails because row it cycles through enbedded table rows.

2009-02-11 Thread Moochie

#Goal Search for page text in table.
def get_row_count_minus_enbedded_rows(table)
num_rows=0
begin
  (1..table.row_count).each do |i|
num_rows = i
table[i]
 end
rescue
  end
  return num_rows
end

$ie.tables.each {|t|
  #Issue This will fail when table is enbedded in another table.
  actual_row_count = get_row_count_minus_enbedded_rows(t)
  puts row_count
  #Error Area.
  t.each do|row| #This will fail if enbedded rows exist.  How can I
code around this?
row.each do |cell|
  if cell.text.include?(text_value.to_s.gsub(/\r?\n/, "
").strip).to_s == "true"
puts "Cell Tag invoked to validate Text"
  end
end
  end
}

#Error Message
table.rb 159: in '[]' : unknown property or method 2 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Error Handling Help

2009-02-11 Thread Moochie

Thanks,

I figure out a way to handle it using.

current.attributes.each do |atr|

Darin


On Feb 11, 11:51 am, Paul Rogers  wrote:
> this pagehttp://msdn.microsoft.com/en-ca/library/ms533055(VS.85).aspx
>
> shows there are several different properties 'type' which probably
> apply to different types of elements.
>
> Im guessing that maybe a link as the focus when you run this code and
> type does not apply to links, hence the error
>
> Paul
>
>
>
> On Wed, Feb 11, 2009 at 10:14 AM, Moochie  wrote:
>
> > def get_active_Element()
> >  active_element = ""
> >  current = $ie.document.activeElement
> >  props = ['id','name','value']
> >  props.each do |prop|
> >    p = current.invoke(prop)
> >    if current.invoke(prop) != nil
> >      case current.invoke("type")  #Error Here
> >        when "text"
> >          active_element = $ie.text_field(prop.to_sym,current.invoke
> > (prop))
> >      end
> >      break
> >    end
> >  end
> >  return active_element
> > end
>
> > Goal,  I'm attempting at get the activeElement and displaying it.
>
> > I'm getting unknow property or method 'type'  HRESULT error code
>
> > It appears that there isn't a activeElement on the page or one that I
> > cannot invoke type.  If I put the focus on the text field this passes
> > with no issues.
>
> > How do I know what I can & can't invoke?
>
> > Thanks,- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Error Handling Help

2009-02-11 Thread Moochie

def get_active_Element()
  active_element = ""
  current = $ie.document.activeElement
  props = ['id','name','value']
  props.each do |prop|
p = current.invoke(prop)
if current.invoke(prop) != nil
  case current.invoke("type")  #Error Here
when "text"
  active_element = $ie.text_field(prop.to_sym,current.invoke
(prop))
  end
  break
end
  end
  return active_element
end

Goal,  I'm attempting at get the activeElement and displaying it.

I'm getting unknow property or method 'type'  HRESULT error code

It appears that there isn't a activeElement on the page or one that I
cannot invoke type.  If I put the focus on the text field this passes
with no issues.

How do I know what I can & can't invoke?

Thanks,








--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: exists? with multiple identifiers

2009-02-03 Thread Moochie

Got it!

require 'test/unit/assertions'
include Test::Unit::Assertions

get_button_properties(button_name)
Case button_name
when "Add Dependent"
button_id = $ie.div
(:id,"TB_ajaxContent").button(:id,"addDependent_submit")
end
return button_id
end

#Start of code

object_id = get_button_properties("Add Dependent")

begin
  assert(object_id.exists?)
puts "object exists"
  rescue
puts "object doesn't exists"
end
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] exists? with multiple identifiers

2009-02-03 Thread Moochie

get_button_properties(button_name)
Case button_name
when "Add Dependent"
button_id = $ie.div(:id,"TB_ajaxContent").button
(:id,"addDependent_submit")
end
return button_id
end

#Start of code

object_id = get_button_properties("Add Dependent")

if object_id.exists?
#Do something
end

if the first part of the button_id ($ie.div(:id,"TB_ajaxContent"))
doesn't exist the object_id.exists? fails "Unable to locate element,
using :id,"TB_ajaxContent")

Why doesn't the .exists? just return false?

What can I do to get around this?  Assertion?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Why doesn't this work put table_id.body(:index, 1).row_count

2009-01-21 Thread Moochie

#Doesn't work
table_id = $ie.table(:id,'value).body(:index,1)
put table_id.row_count

#Works
 row_counter = 0
 table_id.body(:index,1).each do | row |
row_counter = row_counter + 1
 end
puts row_counter
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How can I use a variable in the following $ie.div(:text,/variable_name/)

2009-01-21 Thread Moochie

I got it.

 if message.index("*") != nil
   myvar = message[0,message.index("*")].to_s
   regxmyvar = Regexp.new myvar
   puts $ie.div(:text,regxmyvar)
 end

It failed if If my string end with '('  so I'm guessing special
characters have to be substituted.




On Jan 21, 11:37 am, Moochie  wrote:
> I have a message that appears with a different number at the end,
>
> (*) wild cards - where the number would be
> Message = You have successfully saved the new screening data. (ID =
> ***)
>
> #Check to see if * (wild card exist)
> if message.index("*") != nil
>       #Formats string to ignore wild card text and anything after
> that.
>       message = message[0,message.index("*")]
>       #Try to find the message using formated - Fails here
>       puts $ie.div(:text,eval("/"+message+"/"))
> end
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] How can I use a variable in the following $ie.div(:text,/variable_name/)

2009-01-21 Thread Moochie

I have a message that appears with a different number at the end,

(*) wild cards - where the number would be
Message = You have successfully saved the new screening data. (ID =
***)

#Check to see if * (wild card exist)
if message.index("*") != nil
  #Formats string to ignore wild card text and anything after
that.
  message = message[0,message.index("*")]
  #Try to find the message using formated - Fails here
  puts $ie.div(:text,eval("/"+message+"/"))
end

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Drag and Drop with widgets

2009-01-15 Thread Moochie

Does anyone know how to move widgets on a page?

The class is ui-sortable.

I've search all over and I'm unable to find any helpful information
about drag and drop.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Unable to click link that contains a tag between the text

2009-01-13 Thread Moochie

#This doesn't work to click the below link.
$ie.link(:text,"Total Cholesterol").click

Any suggestions?


#text (Total)

#Text (Cholesterol)


I looked in to replacing  tags with \/n\,  using hpricot, but I
couldn't figure it out.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] blur

2009-01-09 Thread Moochie


I've got a test case that enters a value in a text_field.  I then
click next and I'm expecting a message to appear.

The problem is that when I populate the test and click the button it
puts the focus back on the text field and the message never appears.

I talked to a developer and he said it uses java script function blur,
and informed me that I could click else where after I click next and
the message should appear.  So I attempted to click on the heading,
but I'm still unable to get the message appear when the automation
runs.

Is there a better way to deal with object that contain blur?

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Multiple Attributes Issue

2009-01-08 Thread Moochie


$ie.text_field(:id=>'diagnosis_date',:index=>index)

Creates a error

send:{index=2, :id+>diagnosis_date"} is not a symbol.

I looked and there is a defect, but I"m not sure if it's been fixed


http://wiki.openqa.org/display/WTR/Multiple+Attributes



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] if $ie.label(:text,label.to_s).exists? - Assertion Error

2009-01-08 Thread Moochie

if $ie.label(:text,label.to_s).exists?

I'm getting assert_exists:  Unbale to locate element, using :text,
"Text Value"

Are you unable to check if a label exists using text attribute?

Thanks,

DD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Need to pick amount from the script

2008-12-05 Thread Moochie


 if $ie.div(:text, /Balance:/).exists?
ksh = $ie.d(:text, /Balance:/).text.split(" ")
puts ksh[2]
end


On Dec 5, 4:51 am, Divya <[EMAIL PROTECTED]> wrote:
> Hi,
> View Source is like this:
>
> 
>                         
>                         Sent to: -nn Amount: Ksh 
> 100.00Date: 05/12/2008
> 03:41 PMMessage: Transaction ID: 73538Balance: Ksh
> 7487.68
>
> 
>
> I want to pick that amount Ksh 100 from the script.
>
> Iam New to WATIR can please anyone help me in this regard.
>
> Thanks
> divi
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: browser.attach

2008-12-04 Thread Moochie

I've been using 1.6.2 and I use this browser.attache method with know
problems.

On Dec 4, 1:46 pm, Bret Pettichord <[EMAIL PROTECTED]> wrote:
> Where do you see that it is not supported?
>
>
>
> aidy lewis wrote:
> > Hi,
>
> > On the wiki I am informed that the browser.attach method is not
> > supported in 1.6.2
>
> > What alternative method can I use to hook onto an existing browser?
>
> > Aidy- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Unable to find the value "blah..." within a listbox. Value is retrieved from excel cell

2008-12-01 Thread Moochie

For some reason when I attempt to find a value in a listbox that
contains three dots it doesn't find the value.

Has anyone else seen this?

Thanks,

Darin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Excel Ranges and Ruby

2008-12-01 Thread Moochie

I got this to work.

excel = WIN32OLE.connect('excel.Application')
array = ('1,2,3').split(',')
excel.Range("B207:D207").Value = array



On Dec 1, 1:11 pm, Jason Shelton <[EMAIL PROTECTED]> wrote:
> I have been using value, I accidentally left it out of my message.  What I 
> have looks like:
>
> array = (1,2,3)excel.Range("A1::A3").Value = array
>
> This puts a '1' into cells a1, a2, and a3.  I want a1 = 1, a2 = 2, a3 = 3.  
> Thanks in advance for your help.
>
> - Shelton> Date: Mon, 1 Dec 2008 10:57:57 -0800> Subject: [wtr-general] Re: 
> Excel Ranges and Ruby> From: [EMAIL PROTECTED]> To: 
> watir-general@googlegroups.com> > > > Try using value at the end> > Blah = 
> excel.worksheets(4).Range("B2:J2").Value> puts Blah> > > On Dec 1, 12:46 pm, 
> [EMAIL PROTECTED] wrote:> > All,> >> > I am trying to enter the contents of 
> an array into an excel range.> > Here is a sample of what I am doing now:> >> 
> > array = (0,1,2)> >> > excel.Range("A1::A3) = array> >> > When I do this 
> cells a1, a2, and a3 are all set to 0, and not 0,1,2 as> > I am expecting.  
> Can someone please assist me with this?  I can> > elaborate if necessary.  
> Thanks in advance.> >> > Shelton> 
> _
> Windows Live Hotmail now works up to 70% 
> faster.http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Excel Ranges and Ruby

2008-12-01 Thread Moochie


Try using value at the end

Blah  = excel.worksheets(4).Range("B2:J2").Value
puts Blah


On Dec 1, 12:46 pm, [EMAIL PROTECTED] wrote:
> All,
>
> I am trying to enter the contents of an array into an excel range.
> Here is a sample of what I am doing now:
>
> array = (0,1,2)
>
> excel.Range("A1::A3) = array
>
> When I do this cells a1, a2, and a3 are all set to 0, and not 0,1,2 as
> I am expecting.  Can someone please assist me with this?  I can
> elaborate if necessary.  Thanks in advance.
>
> Shelton
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Page Loading Issues

2008-11-25 Thread Moochie

Like this?

http://blog.headius.com/2008/02/rubys-threadraise-threadkill-timeoutrb.html

On Nov 25, 3:57 pm, Moochie <[EMAIL PROTECTED]> wrote:
> How did you create a separate thread?
>
> Thanks,
>
> Darin
>
> On Nov 25, 1:37 pm, JArkelen <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > I have the same issue on our website.
> > What I have done is to activate a separate thread which gets the url
> > of the page, then waits for 60 seconds and gets the url of the page
> > again. If the url's are the same (the same page is still loading), it
> > performs a browser.refresh
> > Not the prettiest way of solving this, but the problem is that
> > normally the page has to be loaded fully to for watir to continue with
> > the next line of code.
>
> > Cheers,
> > John
>
> > On Nov 25, 3:50 pm, Moochie <[EMAIL PROTECTED]> wrote:
>
> > > Occasionally I have a page that doesn’t fully load successfully.
> > > (sometime it waits for a image to be loaded that never seems to get
> > > loaded)
>
> > > I guessing this is a development issue, but I would like to create a
> > > way to by pass this so I can continue running the test case.
>
> > > My goal is continues automation, but it difficult when these types of
> > > error exist.
>
> > > Does anyone know a way to get around this issue?  Maybe disable the
> > > page load wait method?- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Page Loading Issues

2008-11-25 Thread Moochie

How did you create a separate thread?

Thanks,

Darin

On Nov 25, 1:37 pm, JArkelen <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have the same issue on our website.
> What I have done is to activate a separate thread which gets the url
> of the page, then waits for 60 seconds and gets the url of the page
> again. If the url's are the same (the same page is still loading), it
> performs a browser.refresh
> Not the prettiest way of solving this, but the problem is that
> normally the page has to be loaded fully to for watir to continue with
> the next line of code.
>
> Cheers,
> John
>
> On Nov 25, 3:50 pm, Moochie <[EMAIL PROTECTED]> wrote:
>
>
>
> > Occasionally I have a page that doesn’t fully load successfully.
> > (sometime it waits for a image to be loaded that never seems to get
> > loaded)
>
> > I guessing this is a development issue, but I would like to create a
> > way to by pass this so I can continue running the test case.
>
> > My goal is continues automation, but it difficult when these types of
> > error exist.
>
> > Does anyone know a way to get around this issue?  Maybe disable the
> > page load wait method?- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Page Loading Issues

2008-11-25 Thread Moochie

Occasionally I have a page that doesn’t fully load successfully.
(sometime it waits for a image to be loaded that never seems to get
loaded)

I guessing this is a development issue, but I would like to create a
way to by pass this so I can continue running the test case.

My goal is continues automation, but it difficult when these types of
error exist.

Does anyone know a way to get around this issue?  Maybe disable the
page load wait method?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Watir Podcast

2008-11-24 Thread Moochie

That's awesome, I was under the impression that watir doesn't work
on .NET.

Thanks so much.

On Nov 24, 12:50 pm, "Željko Filipin" <[EMAIL PROTECTED]>
wrote:
> 2008/11/24 Darin Duphorn <[EMAIL PROTECTED]>
>
> > I was asked to automate an application that is written in .Net.
>
> I test .net applications for years, and I use watir (ruby) all the time. Why
> do you want to use watin (.net)?
>
> I recorded a show with Jeroen van Menen (WatiN Lead Developer). You can
> listen to it if you are interested.
>
> http://watirpodcast.com/jeroen-van-menen-on-watin/
>
> Željko
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Looping through LI elements within a specific DIV tag

2008-11-24 Thread Moochie


#Cycles through all the li Tags
counter = 0
$ie.div(:attribute,attribute_valu).lis.each {|li|
  counter = counter  + 1
}


On Nov 24, 10:48 am, Natasha <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Is there a shortcut code for looping through all the LI elements
> within a DIV tag?
>
> I want to find number of LI elements within a DIV tag having id,
> 'listImages'.
>
> Also want to find id's of those LI elements.
>
> Thanks,
> Natasha
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Watir Podcast

2008-11-24 Thread Moochie

I'd like to know how watir may work with application using flex and
flash?

Or

How involved he is with WatrN?















On Nov 24, 11:25 am, "Željko Filipin" <[EMAIL PROTECTED]>
wrote:
> I am recording a show with Paul Rogers, Watir co founder. Friday, November
> 28th, 6pm (utc+1).
>
> If you have a question for him, send it here. I will be monitoring #watir
> irc channel during the recording, so you could post your last minute
> question there too.
>
> A few people said they are interested in co-hosting the show. If the time is
> right for you, please let me know.
>
> If you never heard about Watir podcast, take a look at watirpodcast.com
>
> Željko
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Error in my_thread_global_end

2008-11-07 Thread Moochie

What does this error mean?

"Error in my_thread_global_end"
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Using multiple attribute type to locate label tags?

2008-11-04 Thread Moochie

Yep, that worked.

It appears that using :text and :index together is the issue.

I can user :id and :index together.




On Nov 4, 11:23 am, Michael Hwee <[EMAIL PROTECTED]> wrote:
> Make sure this works:
> $ie.label(:text,"Reported by").exists?
>
>
>
> ----- Original Message 
> From: Moochie <[EMAIL PROTECTED]>
> To: Watir General 
> Sent: Monday, November 3, 2008 11:05:27 AM
> Subject: [wtr-general] Using multiple attribute type to locate label tags?
>
> The below fails when I use multiple attributes :text and :index.
>
> def get_label(page,label,index)
>   case page
>      when "Some Page"
>        case label
>           when "label"
>             label_id = $ie.label(:text=>"Reported
> by",:index=>index)
>        end
>     end
>     return label_id
> end
>
> #This Fails
> puts label_id
>
> I'm able to do this when one of the attributes isn't text.
>
> #Works
> label_id = $ie.label(:id=>"Blah",:index=>index)
>
> Thanks for the help.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Using multiple attribute type to locate label tags?

2008-11-03 Thread Moochie

The below fails when I use multiple attributes :text and :index.

def get_label(page,label,index)
  case page
 when "Some Page"
   case label
  when "label"
label_id = $ie.label(:text=>"Reported
by",:index=>index)
   end
end
return label_id
end

#This Fails
puts label_id

I'm able to do this when one of the attributes isn't text.

#Works
label_id = $ie.label(:id=>"Blah",:index=>index)

Thanks for the help.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: table row_count incorrect

2008-10-24 Thread Moochie
gt; tables, and "ValidMarkup..." contains both the results of the W3C Validator
> >> test and a testtables.html NOT containing inner tables.
>
> >> Just for reference.
>
> >> On Fri, Oct 24, 2008 at 9:18 AM, Nathan Lane <[EMAIL PROTECTED]>wrote:
>
> >>> I'm wondering whether or not this should be a defect really, because
> >>> according to this standards document about tables (
> >>>http://www.w3.org/TR/html401/struct/tables.html) tables probably
> >>> shouldn't be contained in tables. I know that the site you're testing is
> >>> probably using tables as a means of layout, which is outdated and has 
> >>> always
> >>> been an incorrect use of tables. One alternative to trying to fix 
> >>> something
> >>> that isn't really broken is to tell your developers that using tables for
> >>> layout is invalid HTML 4/XHTML and to update it to today's web standards. 
> >>> I
> >>> don't really think that Watir is what's broken here, rather it is the web
> >>> site that is using a broken method. I may be wrong about the site your
> >>> testing using tables for layout, but if it is using tables for layout, 
> >>> then
> >>> that's invalid HTML according to W3C.
> >>> Just some thoughts.
>
> >>> Nathan
>
> >>> On Fri, Oct 24, 2008 at 6:48 AM, Moochie <[EMAIL PROTECTED]>wrote:
>
> >>>> Someone posted this code and it worked really well for me.
>
> >>>> #Get actual row count when enbedded tables exists
> >>>> def get_row_count_minus_enbedded_rows(table)
> >>>>    num_rows=0
> >>>>    begin
> >>>>      (1..table.row_count).each do |i|
> >>>>        num_rows = i
> >>>>        table[i]
> >>>>     end
> >>>>    rescue
> >>>>  end
> >>>>  return num_rows
> >>>> end
>
> >>>> On Oct 23, 10:08 pm, "Alan Baird" <[EMAIL PROTECTED]> wrote:
> >>>> > Paul -
> >>>> > This issue is WTR-26
> >>>> > (http://jira.openqa.org/browse/WTR-26)<
> >>>>http://jira.openqa.org/browse/WTR-26>,
> >>>> > it's been around for a while.  Your solution looks like the one that
> >>>> is in
> >>>> > this ticket.
>
> >>>> > Alan
>
> >>>> > On Thu, Oct 23, 2008 at 9:10 PM, Paul Denize <
> >>>> [EMAIL PROTECTED]>wrote:
>
> >>>> > > Overloading the following seems to get past the limitations.
> >>>>  Perhaps
> >>>> > > someone with more DOM experience can comment if there are any
> >>>> dangers
>
> >>>> > > One thin I did notice is that it picks up  data cells just like
> >>>> > >  ones
>
> >>>> > > class Table
> >>>> > >    def row_count
> >>>> > >        assert_exists
> >>>> > >        return @o.rows().length
> >>>> > >    end
>
> >>>> > >    def to_a
> >>>> > >      assert_exists
> >>>> > >      y = []
> >>>> > >      table_rows = @o.rows()
> >>>> > >      for row in table_rows
> >>>> > >        puts row.to_a.inspect
> >>>> > >        x = []
> >>>> > >        for td in row.cells()
> >>>> > >          x << td.innerText.strip
> >>>> > >        end
> >>>> > >        y << x
> >>>> > >      end
> >>>> > >      return y
> >>>> > >    end
>
> >>>> > > end- Hide quoted text -
>
> >>>> > - Show quoted text -
>
> >>> --
> >>> Nathan Lane
> >>> Home,http://www.nathandelane.com
> >>> Blog,http://nathandelane.blogspot.com
>
> >> --
> >> Nathan Lane
> >> Home,http://www.nathandelane.com
> >> Blog,http://nathandelane.blogspot.com
>
> --
> Nathan Lane
> Home,http://www.nathandelane.com
> Blog,http://nathandelane.blogspot.com- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: table row_count incorrect

2008-10-24 Thread Moochie

Someone posted this code and it worked really well for me.

#Get actual row count when enbedded tables exists
def get_row_count_minus_enbedded_rows(table)
num_rows=0
begin
  (1..table.row_count).each do |i|
num_rows = i
table[i]
 end
rescue
  end
  return num_rows
end



On Oct 23, 10:08 pm, "Alan Baird" <[EMAIL PROTECTED]> wrote:
> Paul -
> This issue is WTR-26
> (http://jira.openqa.org/browse/WTR-26),
> it's been around for a while.  Your solution looks like the one that is in
> this ticket.
>
> Alan
>
> On Thu, Oct 23, 2008 at 9:10 PM, Paul Denize <[EMAIL PROTECTED]>wrote:
>
>
>
>
>
> > Overloading the following seems to get past the limitations.  Perhaps
> > someone with more DOM experience can comment if there are any dangers
>
> > One thin I did notice is that it picks up  data cells just like
> >  ones
>
> > class Table
> >    def row_count
> >        assert_exists
> >        return @o.rows().length
> >    end
>
> >    def to_a
> >      assert_exists
> >      y = []
> >      table_rows = @o.rows()
> >      for row in table_rows
> >        puts row.to_a.inspect
> >        x = []
> >        for td in row.cells()
> >          x << td.innerText.strip
> >        end
> >        y << x
> >      end
> >      return y
> >    end
>
> > end- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Date Add or Subtract

2008-10-20 Thread Moochie

Incase anyone needs to add or subtract  days, months, years or all of
the above from a known date the following works for me.

require 'date'
#Date Add Function
def date_add(mth,day,yr)
  #Set Date Variable
  @new_date = Date.today
  #Month calculations
  if mth != 0
@new_date = @new_date >> mth
  end
  #Day calculation
  if day != 0
@new_date = @new_date.+(day)
  end
  #Year calculation
  if yr != 0
@new_date = @new_date >> yr * 12
  end
  #Returns new date
  return @new_date
end
@new_date = date_add(2,3,4)
puts @new_date.strftime("%m/%d/%Y")
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Outlook recommendations

2008-10-15 Thread Moochie

I've got to automate a test script that opens outlook and emails a
message to our application.  Then I verify the email appears within
the application.

Has anyone done any scripting agains outlook?

Does anyone have any ideas where I shouls start?

Thanks,

DD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: check the pagetext

2008-10-13 Thread Moochie

Bret,

When you user browser.text, can you figure out if the text is visible?

I used the pagecontainstext to start with, but it would identify text
that was invisible on the page.

Thanks,




On Oct 13, 9:45 am, Bret Pettichord <[EMAIL PROTECTED]> wrote:
> Have you looked at browser.text? Personally, I always use this (or the
> text method on something more specific). I find the pagecontainstext
> method confusing.
>
> Bret
>
>
>
> bugs apple wrote:
> > Hi, all
>
> > As we known, pagecontainstext method could check the text that
> > contained current page, including the values in the object
>
> > maybe the pagecontainstext method was designed like below,
> >   if (ie.getDocument.body.innertext =~ /#{text}/) != nil
> >          puts true
> >       else
> >          puts false
> >       end
>
> > but, that is not my expect, I only want to check the pure text, as the
> > label displayed on page, which is not belong to any object value or
> > dropdown/select list item.
> > who can provide some good way to check the text?- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: check the pagetext

2008-10-13 Thread Moochie

It's hard because text exist in many tags.

I've done the following.

 #Cycles through all the Span Tags
  $ie.spans.each {|span|
#Verify Labe is Visible
if span.visible?.to_s == "true"
  #Label Matches Expected Label
  if text_value == span.text
text_exists_flg = "True"
break
  end
end
  }
  #Iterates through all li tags
  if text_exists_flg == "False"
#Cycles through all the P Tags
$ie.lis.each {|li|
  #Verify unordered list value is Visible
  if li.visible?.to_s == "true"
#unordered list Expected Label
if text_value.gsub(/\r?\n/, " ").strip == li.text.gsub(/\r?
\n/, " ").strip
  text_exists_flg = "True"
  break
end
  end
}
  end
  if text_exists_flg == "False"
#Cycles through all the P Tags
$ie.ps.each {|p|
  #Verify Labe is Visible
  if p.visible?.to_s == "true"
#Label Matches Expected Label
if text_value.to_s.gsub(/\r?\n/, " ").strip ==
p.text.to_s.gsub(/\r?\n/, " ").strip
  text_exists_flg = "True"
  break
end
  end
}
  end
  #Iterates through all the dif tages
  if text_exists_flg == "False"
#Cycles through all the P Tags
$ie.divs.each {|div|
  #Verify Labe is Visible
  if div.visible?.to_s == "true"
#Label Matches Expected Label
if text_value.gsub(/\r?\n/, " ").strip == div.text.gsub(/\r?
\n/, " ").strip
  text_exists_flg = "True"
  break
end
  end
}
  end
  #Cycle through all Table Cells incase the Text Exists within a table
  if text_exists_flg == "False"
$ie.tables.each {|t|
  t.each do|row|
row.each do |cell|
  if cell.text.include?(text_value.to_s.gsub(/\r?\n/, "
").strip).to_s == "true"
text_exists_flg = "True"
break
  end
end
if text_exists_flg == "True"
  break
end
  end
  if text_exists_flg == "True"
break
  end
}
  end
  #Cycle through all Address Tags
  if text_exists_flg == "False"
   $ie.document.getElementsByTagName('ADDRESS').each{|
address|
  #Label Matches Expected Label
  if text_value.gsub(/\r?\n/, "").strip == address.innertext.gsub(/
\r?\n/, " ").strip
text_exists_flg = "True"
break
  end
}
  end
  #Cycle through all DD Tags
  if text_exists_flg == "False"
   $ie.document.getElementsByTagName('DD').each{|dd|
  #Label Matches Expected Label
  if text_value.gsub(/\r?\n/, "").strip == dd.innertext.gsub(/\r?
\n/, " ").strip
text_exists_flg = "True"
break
  end
}
  end
   #Cycle through all LEGEND Tags
  if text_exists_flg == "False"
   $ie.document.getElementsByTagName('LEGEND').each{|address|
  #Label Matches Expected Label
  if text_value.gsub(/\r?\n/, "").strip == address.innertext.gsub(/
\r?\n/, " ").strip
text_exists_flg = "True"
break
  end
}
  end

On Oct 13, 8:20 am, "bugs apple" <[EMAIL PROTECTED]> wrote:
> Hi, all
>
> As we known, pagecontainstext method could check the text that contained
> current page, including the values in the object
>
> maybe the pagecontainstext method was designed like below,
>   if (ie.getDocument.body.innertext =~ /#{text}/) != nil
>          puts true
>       else
>          puts false
>       end
>
> but, that is not my expect, I only want to check the pure text, as the label
> displayed on page, which is not belong to any object value or
> dropdown/select list item.
> who can provide some good way to check the text?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Converting Dates Question

2008-10-09 Thread Moochie


puts DateTime.parse('2007-12-30').strftime('%m/%d/%Y')

Worked, Thanks Andy.

Jason, You're suppose to be on vacation.  Step away from the computer.

Also, I tried that one.  Thanks though.

DD

On Oct 9, 12:10 pm, "andy sipe" <[EMAIL PROTECTED]> wrote:
> If the value you are getting from the database is a string, try this:
>
> irb(main):004:0> require 'date'
> => true
> irb(main):005:0> dt = DateTime.parse('2007-12-30')             =>
> #
> irb(main):006:0> dt.year
> => 2007
> irb(main):007:0> dt.day
> => 30
> irb(main):008:0> dt.month                                                =>
> 12
> irb(main):010:0> str = dt.strftime('%m/%d/%Y')                  =>
> "12/30/2007"
>
> If the value you are getting isn't a string then you'll either have to
> convert it to a Date or a string and go from there.
>
> -andy
>
> On Thu, Oct 9, 2008 at 1:03 PM, Jason Trebilcock <[EMAIL PROTECTED]
>
>
>
> > wrote:
> > Doing it through SQL:
>
> > select date_format(now(), '%m/%d/%Y')
> > Replace now() with your variable and give it a whirl.
>
> > On Thu, Oct 9, 2008 at 11:08 AM, Moochie <[EMAIL PROTECTED]>wrote:
>
> >> How can I convert the following dateformate?
>
> >> puts "2007-12-30".strftime("%m/%d/%Y")
> >> puts "2007-12-30".to_a.strftime("%m/%d/%Y")
>
> >> The I've pulled the date from the database, but I want to format as
> >> 12/30/2007.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Converting Dates Question

2008-10-09 Thread Moochie


How can I convert the following dateformate?

puts "2007-12-30".strftime("%m/%d/%Y")
puts "2007-12-30".to_a.strftime("%m/%d/%Y")

The I've pulled the date from the database, but I want to format as
12/30/2007.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---