Re: [Wtr-general] report failure question?

2006-09-22 Thread Luke
I just want to make assert of link, after i remove rescue block, assert method works and I can see that test failed on report, but it skips my test case and I wish to avoid it, I want to add some extra information to my logger file when test fails
def test_namemethod begin   assert($ie.link(:text, 'name_of_link').exists?) # here i want to add some information to my logger when test succed or failed $logger.log('some information')
 endend#the in the end of file I generate reportsuite = Test::Unit::TestSuite.new(Name of suite) suite  NameofMyClass.suite FileUtils.mkdir_p 'report' Test::Unit::UI::
Reporter.run(suite, './report', :html)
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] report failure question?

2006-09-22 Thread Luke
I answer myself I've done something like this:beginassert($ie.link(:text, 'name_of_link').exists?)rescue =e#my extra code to do something when assert failed, then i return exceptionraiseend
now it seems to work, does anyone know better way?Luke
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] cell access

2006-09-22 Thread Luke
Sorry for asking but I can't deal with it, I've got a table on page and I want to get to the cell Action can someone show me how to do it,I can't firgure out and fail all the time
table id=form1:ReportUnit:tblDetails style=font-size: 11px;width: 640px 
class=Tbl border=0 
cellpadding=0 cellspacing=0caption
 id=form1:ReportUnit:tblDetails:_titleBar class=TblTtlTxtDetail
/captiontr id=form1:ReportUnit:tblDetails:tableRowGroupS:_columnHeaderBar:0
th id=form1:ReportUnit:tblDetails:tableRowGroupS:colLinkS:_columnHeader 
class=TblColHdr align=center scope=
colspan class=TblHdrTxtAction/span/
th...
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] image

2006-09-22 Thread Lucas K
how to get to link in table? I need to get first to the table then to link in particular cell, how can i access to that? Lukas

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] Intermittent RPC error

2006-09-22 Thread brian . kejser
Hi

Once and a while I get the following two errors:

WIN32OLERuntimeError: Unknown property or method: `visible'
HRESULT error code:0x800706be
  The remote procedure call failed.

WIN32OLERuntimeError: Unknown property or method `quit'
HRESULT error code:0x800706ba
  The RPC server is unavailable.

Is this caused by something I'm doing wrong or is this a flaw in Watir or
the Win32 Ruby library?

I'm using Watir 1.4.1 with Ruby 1.8.2-15.

Thanks




___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] image

2006-09-22 Thread Charley Baker
Something like this:
$ie.table(:id, 'table_id')[2][4].link(:url, /part_of_link/).click
where 2 refers to the 2nd row and 4 is the 4th cell in that row,
replace with whatever row/cell you're looking for. The :url in link is
looking for some text (part_of_link) that's contained in the url for
the link.

It might also help if you post what you've tried in your script and
some html from the page. The ie developer toolbar can help when
identifying elements in the dom:
http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038displaylang=en

-Charley


On 9/22/06, Lucas K [EMAIL PROTECTED] wrote:
 how to get to link in table? I need to get first to the table then to link
 in particular cell, how can i access to that?

 Lukas

 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] report failure question?

2006-09-22 Thread Bret Pettichord
Luke wrote:
 now it seems to work, does anyone know better way?
Use the verify method that i've posted to this mailing list and which is 
included in 1.5.1.1100

Bret

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Formatting Excel Column Width

2006-09-22 Thread Sun
Technically this is a Ruby question but...since it is useful to record test run 
timing information in Excel format, I think it is relevant to this forum. The 
question is...suppose I write out some test output that looks like this:
===
Test,   Acceptable log in time, 5,  Actual time to log in,  1.683,  OK
Test,   Acceptable admin screen access time,5,  Actual admin screen 
access time,3.235,  OK
Test,   Acceptable user search time,5,  Actual user search time,
2.804,  OK
Test,   Acceptable user info time,  5,  Actual user info time,  1.923,  
OK
===

So, it went through 4 screens. The environment is Test. 2nd column describes 
acceptable time, 3rd column specifies that time, 4th column states actual time, 
5th column is actual time, last column will be OK or NotOK, depending on 
whether actual exceeds expected.

So far, so good. However, I am simply opening and writing out to a CSV file, 
like so:
===
timeSpreadsheet.puts executionEnvironment + ,Acceptable user info time, + 
acceptableTimeDisplayUser.to_s + ,Actual user info time, + (endTime - 
beginTime).to_s + , + resultValue
===

No problems, however, the column widths in the resulting file, when opened by 
Excel, are the standard 8 character columns. Obviously then, when the file is 
opened, much of the descriptive text in columns 2 and 4 is hidden. So the 
question is twofold:
(a) Is it possible, when writing to a CSV file, to do so in such a way that 
when Excel opens the file, it will automatically widen the columns to fit? (I 
think no.)
(b) What then, would be the Excel command, to adjust the column to fit? I can 
do this:
===
excel = WIN32OLE::new('excel.Application')
workbook = excel.Workbooks.Open(../PC/ + Time.now.strftime(%d-%b-%y) + 
.csv)
worksheet = workbook.Worksheets(1) #get hold of the first worksheet
#Format workbook columns
worksheet.range(b1:b4).Interior['ColorIndex'] = 36 #pale yellow
# How do I widen the 2nd column?
workbook.save
workbook.close
excel.Quit
===
So I can open the csv file as an Excel file and make a format change (turn the 
2nd column yellow.) But -- I cannot find anywhere, on any forum, or the Ruby 
online documentation, how to autofit the column to the text.

And -- no, I do not want to add someones alphaware library if possible, I want 
to use straight old WIN32OLE. Is this possible?
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=4494messageID=12320#12320
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Intermittent RPC error

2006-09-22 Thread Bret Pettichord
[EMAIL PROTECTED] wrote:
 Hi

 Once and a while I get the following two errors:

 WIN32OLERuntimeError: Unknown property or method: `visible'
 HRESULT error code:0x800706be
   The remote procedure call failed.

 WIN32OLERuntimeError: Unknown property or method `quit'
 HRESULT error code:0x800706ba
   The RPC server is unavailable.

 Is this caused by something I'm doing wrong or is this a flaw in Watir or
 the Win32 Ruby library?

 I'm using Watir 1.4.1 with Ruby 1.8.2-15.

 Thanks
   

This is a flaw in Watir, for which there are a couple of workarounds.

This can happen in the following scenario

1. create browser
2. close browser
3. create browser
-- error sometimes happens here

The problem lies in the way IE is structured and the way that Watir 1.4 
interacts with it. Specifically, Watir creates a client windows that 
interacts with the IE RPC Server. This is not a web server, but rather 
the IE process running on your computer. When the last client to this 
server is closed, the server will also start closing, but this happens 
asynchronously. In your case, you are probably trying to get a new IE 
window, and it is trying to connect to the IE RPC server that is 
actually in the process of closing down.

The simplest workaround is to reuse IE windows instead of opening and 
closing them. Another workaround is to leave IE window open at the 
beginning of your session (it can be invisible) and then when you open 
and close windows, the IE RPC Server will never shutdown, because there 
always will be one window connected to it.

Perhaps the best solution is to start a separate IE process for each IE 
window. We have prototyped this approach in the Watir/Contrib directory 
of 1.5.1.1100.

Bret


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Intermittent RPC error

2006-09-22 Thread Charley Baker
I've never had this error, but there are a couple of threads on the
mailing list which might help you out:

http://www.mail-archive.com/wtr-general@rubyforge.org/msg04445.html
http://www.mail-archive.com/wtr-general@rubyforge.org/msg03870.html

-Charley

On 9/22/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hi

 Once and a while I get the following two errors:

 WIN32OLERuntimeError: Unknown property or method: `visible'
 HRESULT error code:0x800706be
   The remote procedure call failed.

 WIN32OLERuntimeError: Unknown property or method `quit'
 HRESULT error code:0x800706ba
   The RPC server is unavailable.

 Is this caused by something I'm doing wrong or is this a flaw in Watir or
 the Win32 Ruby library?

 I'm using Watir 1.4.1 with Ruby 1.8.2-15.

 Thanks




 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general


 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Managing the Watir Project

2006-09-22 Thread Bret Pettichord
I am pleased to announced that Charley Baker has accepted the position
of project manager for the Watir project. Charley has been helping the
project in numerous ways. He made sure that all the open issues were
migrated and documented in Jira, which allowed me to put together the
dynamic road map that i published the other day. He has also been key
in defining our new policies regarding contributions.

Several of you have generously offered to help out with documenting
Watir. Thank you. Charley will be coordinating this effort and will be
contacting you.

He knows my thoughts on what kind of documentation we need. I will
just say one thing. To me, the most valuable thing would be to review
the questions that show up on this list and see what we could do to
make the answers easier for people to find. Not by searching the list,
but by enhancing our our documentation and websites.

Charley will also provide an alternative channel for appeals. Like any
developer, there are areas where i may dismiss bug reports or
suggestions too quickly. Charley will help make sure that the project
doesn't suffer when this happens.

As his day job, Charley is rolling out Watir at Bay Area Retailer, and
is quite aware of many struggles that our users currently face. Please
feel free to contact Charley directly if you would like to help us in
any way.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general