[wtr-general] How to capture Errors in batch running

2009-07-29 Thread Prince3105

Hi All,

I am a newbie of Watir. I have been using Watir for the past 10
months. I have created so many individual scripts and i run all those
by using Scite editor and my scripts update the test results in Excel
sheet, going good no issues in it. If any error occurs in the test run
i can easily capture it in Scite editor so i can correct my script.

I usually run my batch script by using Vbscript by using below code.

Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
Set WshShell = WScript.CreateObject("WScript.Shell")

oAutoIt.Sleep 5000
WshShell.Run "E:\DATA\Prince\WatIR\iComet\Tests\StoresAndSpares
\Stores&Spares_Masters.RB"
oAutoIt.Sleep 5000
i = 0
Do Until i=10
  If oAutoIt.WinExists("c:\ruby\bin\ruby.exe") Then
oAutoIt.Sleep 3
else
i = i + 1
  End If
Loop

WshShell.Run "E:\DATA\Prince\WatIR\iComet\Tests\StoresAndSpares
\RolesRights_S&S.RB"
oAutoIt.Sleep 5000
i = 0
Do Until i=10
  If oAutoIt.WinExists("c:\ruby\bin\ruby.exe") Then
oAutoIt.Sleep 3
else
i = i + 1
  End If
Loop

WshShell.Run "E:\DATA\Prince\WatIR\iComet\Tests\StoresAndSpares
\BPT_S&S.RB"


Above code working good and it runs the ruby files in command prompt ,
but unfortunately any error occurs in the middle of the execution
suddenly Ruby closes the current test and starts the next test. So i
couldn't collect the error details. So if any methods available in
Watir to collect the error log details please tell me.

Since am a new user of Watir i couldn't use it extensively so if any
easy methods or libraries are available please post it.


Thanks,
Prince3105

--~--~-~--~~~---~--~~
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 support i18n testing?

2009-07-29 Thread Zhimin


Here are some screencasts of running rWebUnit (an extension of Watir)
tests against chinese web sites.
  http://www.itest2.com/cn/screencasts

My Env and Tools: iTest2 IDE, iTest2/Watir Recorder on Windows XP
(Simplified Chinese)

Zhimin

On Jul 30, 4:25 am, sHiVa  wrote:
> Hi Zhimin
>
> I had a try to automate Chinese Google website using watir. All the
> Chinese characters are displayed as square boxes when i use IE
> developer tool bar and when I try to copy Chinese characters in to
> Scite, those are displayed as "?".
> Please tell me the approach for testing Chinese (any of other
> languages) web sites. - Thanks
>
> Regards
> Siva
>
> On Jul 28, 3:32 am, Zhimin  wrote:
>
> > Watir supports i18n, I have been using it to test a web site in
> > chinese.
> > I couldn't paste the sample here.
>
> > But had no luck with FireWatir, it seems JSSH not supporting i18n.
>
> > If you want to give a try, download iTest2 (http://itest2.com),
> > open project c:\Program Files\iTest2\samples\demo\demo.tpr
>
> > Run chinese_spec.rb
>
> > Zhimin
>
> > On Jul 24, 3:02 pm, Krapa  wrote:
>
> > > Hi,
>
> > > How to test i18n (Chines, Japanies etc...) applications using watir?
> > > Do we have any approach for it?
> > > Does watir support it?
>
>
--~--~-~--~~~---~--~~
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: Getting text between two tags

2009-07-29 Thread Mark Anderson

> There is a line of text that I want to extract.  It is found in some HTML
> that follows this pattern:
> 
>  
> Some text
> 
> Another link (variable text)
> 
>   Text I want to extract.
> 
> Updated by name (variable) X hours ago [ href=...>Comment]
> 
> I have the impression that I'd use XPath somehow, but am unsure how to
> proceed since the text I want isn't in any page element.
> 
> - Aaron

Here's how I would do it with a regular expression:

$ie.html =~ /\s*(.*)\s*\s*Updated/
puts $1

That doesn't pull the tab before 'Text', and assumes that 'Updated' only
appears once in the html.  I don't guarantee that this regexp will work with
any text other than what you provided above, where it returns "Text I want
to extract." in $1 and spits it out to the screen.

Hope this gives you a starting place.
    /\/\ark

 

__ Information from ESET NOD32 Antivirus, version of virus signature
database 4289 (20090729) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 



--~--~-~--~~~---~--~~
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: Watir fire_event that opens a modal dialog no wait needed

2009-07-29 Thread Adrian Ghidu
click_no_wait doesn't work, only onmousedown opens the modal dialog. Is
there a no_wait for fire_event?
Thanks

On Wed, Jul 29, 2009 at 11:32 PM, Charley Baker wrote:

> There are so many definitions around modal dialogs, did you call
> click_no_wait before your method. There are a variety of ways to deal with
> dialog boxes, all have been posted, so search for it if that doesn't work.
> Post your solution if it does work.
>
>
>
>
> Charley Baker
> blog: http://blog.charleybaker.org/
> Lead Developer, Watir, http://wtr.rubyforge.org
> QA Architect, Gap Inc Direct
>
>
>
> On Wed, Jul 29, 2009 at 2:26 PM, ghidu  wrote:
>
>>
>> Hello,
>> Sorry for the previous message, the finger slipped onver SPACE :)
>> I cannot open a modal dialog and return from it.
>> This is waht I do:
>> Thread.abort_on_exception = true
>>   t = Thread.new {
>>button.fire_event("onmousedown")
>> }
>>
>> t.kill
>>
>> It never reaches t. Firing the event onmouse down on button opens the
>> modal dialog.
>> How can I get it to work?
>> 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: Watir fire_event that opens a modal dialog no wait needed

2009-07-29 Thread Charley Baker
There are so many definitions around modal dialogs, did you call
click_no_wait before your method. There are a variety of ways to deal with
dialog boxes, all have been posted, so search for it if that doesn't work.
Post your solution if it does work.




Charley Baker
blog: http://blog.charleybaker.org/
Lead Developer, Watir, http://wtr.rubyforge.org
QA Architect, Gap Inc Direct


On Wed, Jul 29, 2009 at 2:26 PM, ghidu  wrote:

>
> Hello,
> Sorry for the previous message, the finger slipped onver SPACE :)
> I cannot open a modal dialog and return from it.
> This is waht I do:
> Thread.abort_on_exception = true
>   t = Thread.new {
>button.fire_event("onmousedown")
> }
>
> t.kill
>
> It never reaches t. Firing the event onmouse down on button opens the
> modal dialog.
> How can I get it to work?
> 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: Getting text between two tags

2009-07-29 Thread Dylan

Well, if the only text that is variable is the text within the 
tags, are there any identifying marks for that link? an id? Otherwise,
I suppose you could just get the text for the whole page and subtract
the text you already know (i.e. the non-variable text). Not pretty or
elegant, but it would get the job done.

-Dylan


On Jul 29, 12:47 pm, "Aaron MacDonald"  wrote:
> There is a line of text that I want to extract.  It is found in some HTML
> that follows this pattern:
>
>  
> Some text
> 
> Another link (variable text)
> 
>         Text I want to extract.
> 
> Updated by name (variable) X hours ago [ href=...>Comment]
>
> I have the impression that I'd use XPath somehow, but am unsure how to
> proceed since the text I want isn't in any page element.
>
> - Aaron
--~--~-~--~~~---~--~~
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] Watir fire_event that opens a modal dialog no wait needed

2009-07-29 Thread ghidu

Hello,
Sorry for the previous message, the finger slipped onver SPACE :)
I cannot open a modal dialog and return from it.
This is waht I do:
Thread.abort_on_exception = true
   t = Thread.new {
   button.fire_event("onmousedown")
}

t.kill

It never reaches t. Firing the event onmouse down on button opens the
modal dialog.
How can I get it to work?
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] Watir fire_event that opens a modal dialog no wait needed

2009-07-29 Thread ghidu

Hello,
I cannot open a modal dialog and return from it.
This is waht I do:
Thread.abort_on_exception = true
   t = Thread.new {
 t[6].fire_event("onmousedown")

  puts "after event"
  sleep(1)
# raise "Exception from thread"
}
puts "after thread"
for i in (1..100)
  puts i
end

t1.kill
--~--~-~--~~~---~--~~
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] Getting text between two tags

2009-07-29 Thread Aaron MacDonald

There is a line of text that I want to extract.  It is found in some HTML
that follows this pattern:

 
Some text

Another link (variable text) 

Text I want to extract.

Updated by name (variable) X hours ago [Comment]

I have the impression that I'd use XPath somehow, but am unsure how to
proceed since the text I want isn't in any page element.

- Aaron
 



--~--~-~--~~~---~--~~
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 support i18n testing?

2009-07-29 Thread sHiVa

Hi Zhimin

I had a try to automate Chinese Google website using watir. All the
Chinese characters are displayed as square boxes when i use IE
developer tool bar and when I try to copy Chinese characters in to
Scite, those are displayed as "?".
Please tell me the approach for testing Chinese (any of other
languages) web sites. - Thanks

Regards
Siva

On Jul 28, 3:32 am, Zhimin  wrote:
> Watir supports i18n, I have been using it to test a web site in
> chinese.
> I couldn't paste the sample here.
>
> But had no luck with FireWatir, it seems JSSH not supporting i18n.
>
> If you want to give a try, download iTest2 (http://itest2.com),
> open project c:\Program Files\iTest2\samples\demo\demo.tpr
>
> Run chinese_spec.rb
>
> Zhimin
>
> On Jul 24, 3:02 pm, Krapa  wrote:
>
>
>
> > Hi,
>
> > How to test i18n (Chines, Japanies etc...) applications using watir?
> > Do we have any approach for it?
> > Does watir support it?
--~--~-~--~~~---~--~~
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: Script to click the dynamically generated link.

2009-07-29 Thread Chuck van der Linden

On Jul 28, 10:06 pm, Swapnal  wrote:
> Hi,
>
> In this application when we add user every user will have the 'Edit' and
> 'Delete' link.
>
> a - associate
>
> >                                                 
> >                                                 
>
> >                                                 
> href="AppControl?pg=List> Users&ret=Edit&id_user=1">Edit|
> >                                                 
> href='javascript:confirmDelete("AppControl?pg=List
>
> > Users&ret=Delete&id_user=1")'>Delete
>
> I want to write the code to click the 'Edit' link from above code.
>
> How can I write it?
>

based on just the code fragent above?

   browser.link(:text, 'Edit').click

if that doesn't answer your question, and given the thread I expect it
won't, then please go back and answer EACH of the questions I asked in
my prior post.  Most importantly, how do you as a user know which
'edit' link you want to click?and if your answer is 'for the user
I just created' or something along those lines, then understand that
my response will then be something like 'how do you know when using
the application manually, which is the edit link for the user you just
created.  Remember, in the code sample you gave, those of us who don't
know your application, have NO IDEA which text that would be displayed
represents a username..
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---