Re: Selenium tests
Re: Selenium tests
- Subject: Re: Selenium tests
- From: Simon McLean <email@hidden>
- Date: Fri, 29 Jun 2007 19:02:44 +0100
Hi Chuck,
Here is a very simple example that fails every time under "run" but
works under "walk" (i've included the log too):
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>TravelPoint-CreateItinerary</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">TravelPoint-CreateItinerary</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/cgi-bin/WebObjects/TravelPoint.woa/wa/Nav/default</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[2]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>document.forms[0].elements[0]</td>
<td>test</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>document.forms[0].elements[1]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>document.forms[0].elements[3]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
* [info] Executing: |open | /cgi-bin/WebObjects/TravelPoint.woa/
wa/Nav/default | |
* [info] Executing: |click | //a[2] | |
* [warn] triggerMouseEvent assumes setting screenX and screenY
to 0 is ok
* [info] element doesn't have fireEvent
* [info] element has initMouseEvent
* [info] Executing: |type | document.forms[0].elements[0] | test |
* [info] Executing: |clickAndWait | document.forms[0].elements
[1] | |
* [error] document.forms[0] has no properties
Simon
On 29 Jun 2007, at 17:50, Chuck Hill wrote:
On Jun 29, 2007, at 8:13 AM, Simon McLean wrote:
Hi All -
I have some selenium tests that work when I "walk" through them,
but fail when i "run" through them.
Has anyone else seen this behavior ? Any known workarounds ?
Thanks, Simon
ps. i am using Selenium IDE with chuck's wolocators.js IDE
extensions, not ERSelenium
The problem you are seeing is that when running the tests, it can
go much faster that you can as a person and much faster than the
IDE walkthrough. What this does is to expose concurrency bugs and
lack of synchronization in your tests. Adding a waitFor... step in
the tests or the occaisional sleep command will avoid these. If
your app is slow, you might also get timeout errors. Use
setTimeout to set a realistic amount of time to wait.
Post some real examples and I will show you how I would fix them.
Chuck
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden