myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bertrand, Shawn R" <shawn.bertr...@tycoelectronics.com>
Subject RE: Selenium and badboy on JSF
Date Mon, 05 Nov 2007 20:39:13 GMT
You could use the location strategy feature introduced in Selenium
Remote Control 0.9.2:

 

http://release.openqa.org/selenium-remote-control/0.9.2/doc/java/com/tho
ughtworks/selenium/DefaultSelenium.html#addLocationStrategy(java.lang.St
ring,%20java.lang.String)

 

We use it for the Trinidad tree control to allow our tests to click on
the arrows next to each tree node regardless of the underlying index of
the node (our locator is the displayed tree node text).  This of course
is possible only because the tree is rendered in a very flat way using
the table renderer (thank goodness for that...).

 

Regards,

 

Shawn Bertrand

Tyco Electronics Corporation

 

________________________________

From: Yaron Spektor [mailto:yaron.spektor@b6systems.com] 
Sent: Monday, November 05, 2007 2:13 PM
To: MyFaces Discussion
Subject: Selenium and badboy on JSF

 

Hi,

I was trying out Selenium and badboy today.

I couldn't make any of them work for me.

For example I used Selenium IDE and tried to record a very short
session:

1. Go to a search page 

2. click an id of a user ("1111") 

3. click on "search" ("form1:doSearch") 

4. from a list of users in a table, click on the link of this user id
("form1:_id25:0:comp_760").

As I am working with JSF creating a dynamic id for each component the
first time around I recorded "form1:_id25:0:comp_760" after that I got
"form1:_id25:0:comp_930" etc. (the comp number changed). How do I make
Selenium (or badboy for that matter) realize this is the same link? I
googled this for a long time not finding any solution. I tried xpath but
it gave me the same "form1:_id25:0:comp_760", I also tried using the
xpath table location and it didn't work: ("//tr[2]/td/table.1.0") 

 

 

 

Here is the source from selenium IDE on my first attempt: 

 

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>New Test</title>

</head>

<body>

<table cellpadding="1" cellspacing="1" border="1">

<thead>

<tr><td rowspan="1" colspan="3">New Test</td></tr>

</thead><tbody>

<tr>

            <td>open</td>

            <td>/proj/employeeSearch.faces</td>

            <td></td>

</tr>

<tr>

            <td>type</td>

            <td>form1:_id22</td>

            <td>1111</td>

</tr>

<tr>

            <td>clickAndWait</td>

            <td>form1:doSearch</td>

            <td></td>

</tr>

<tr>

            <td>clickAndWait</td>

            <td>form1:_id25:0:comp_760</td>

            <td></td>

</tr>

 

</tbody></table>

</body>

</html>

 

Yaron

 


Mime
View raw message