[ start | index | login ]
start > Development > Selenium

Selenium

Created by mpecher. Last edited by mpecher, 6 years and 149 days ago. Viewed 841 times. #5
[diff] [history] [edit] [rdf]
labels
attachments
Selenium is a test tool for web applications.
Selenium tests run directly in a browsers, just as real users do. And they run in Internet Explorer, Mozilla and Firefox on Windows, Linux and Macintosh.

Taken from a Selenium doco site: >>http://www.openqa.org/selenium/index.html.

Playing around with it a bit here at work. Seems quite good. Once set up, to write a test, you place the thing you're testing for in a HTML row:
eg.:

<tr><td>clickAndWait</td><td>//input[@value='Modify']</td><td> </td></tr>
<tr><td>assertTextNotPresent</td> <td>Previous  Page</td><td> </td></tr>
This is best place inside a jsp. If using jsp, this can include other jsp for common functionality such as login etc.

eg: an example login jsp:

<tr>
  <td>open</td>
  <td>>>http://localhost:8080index.jsp</td>
  <td> </td>
</tr>
<tr><td>assertTextPresent</td> <td>Login Portlet</td><td> </td></tr>
<tr><td>type</td> <td>userID</td><td>wpsadmin</td></tr>
<tr><td>type</td> <td>password</td><td>wpsadmin</td></tr>
<tr><td>clickAndWait</td> <td>//input[@value='Log in']</td><td> </td></tr>

This could then simply be included by the calling jsp as:

<jsp:include page="../shared/login.jsp" />

One could even pass params if needed such as:

<jsp:include page="../shared/selectWar.jsp">
  <jsp:param name="warName" value="identityManagement" />
</jsp:include>

Where the selectWar.jsp called would be able to access the variable with:

String warName = request.getParameter("warName");
All standard jsp stuff.
Please login to post a comment.

Menu:
Java & J2EE
Development
Books

Help:
Help FAQ
Formatting


< May 2012 >
SunMonTueWedThuFriSat
12345
6789101112
13141516171819
20212223242526
2728293031


Logged in Users: (0)
… and a Guest.



Disclaimer: Views and opinions are that of the individual author, and not that of Marand Custom Solutions. This site is an open forum for technical content, and the company accepts no liability for any content or view expressed.