Monday, 7 March 2011

Exercise 4 - Registration Script

Aim:
Create a user registration script against the Wordpress.com site.


Difficulty Level: Easy/Medium

What you will learn?
  • Record and playback 
  • usage of the IDE
  • Javascript functions
  • random variables
  • debugging
Tips:
  1. Use a JavaScript function to generate the random variable
  2. Record the script initially without using javascript and ensure that the script works before adding the random variables.
Pre-requisites:

Exercise  Steps
  1. navigate to the http://www.wordpress.com
  2. login using username: foundationselenium, password: password
  3. Click on the Login button
  4. Click on Users
  5. Click on Invite link
  6. Enter the User details ( use a javascript function) 
  7. Click on Send Invite button
Conclusions

Related Entries
Solution:

Here is the script in HTML texts:
--------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://wordpress.com/" />
<title>UserRegistration</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">UserRegistration</td></tr>
</thead><tbody>
<tr>
	<td>open</td>
	<td>http://wordpress.com/</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>user_login</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>user_login</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>user_login</td>
	<td>foundationselenium</td>
</tr>
<tr>
	<td>click</td>
	<td>user_pass</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>user_pass</td>
	<td>password</td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>login-form</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>css=#wp-admin-bar-blog-1-d &gt; a</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>link=Users</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>link=Invites</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>fname</td>
	<td>testfirst</td>
</tr>
<tr>
	<td>type</td>
	<td>lname</td>
	<td>testlast</td>
</tr>
<tr>
	<td>type</td>
	<td>email</td>
	<td>javascript{&quot;Test&quot; + new Date().getMilliseconds()+&quot;@gmail.com&quot;;}</td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>Submit</td>
	<td></td>
</tr>
</tbody></table>
</body>
</html>


Helpful Video:


1 comment:

Thank you for your comment
- Time2test Team