Translate

Sunday, October 23, 2016

Back to Selenium IDE

I thought I’d take a minute and give an example of Selenium IDE. I know it has been a while but this whole blog stemmed around Selenium IDE and not being able to find things when I was searching for them. Before I go into this example I would like to point out that since I have last written on Selenium IDE it has changed a little bit how to get to it.
This .gif should help on how to get into it now.
This program is a simulation of google clicks, which is just for practice seeing how it is against google’s terms of service to use it but it does have some pretty nice things to remember when using Selenium IDE.
Make sure to look at the various uses of conditions and searches. It is a nice refresher course of how to do moderate level test cases.
This is the snapshot of the program:


If you can’t read it this is the source code for the program:
<?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="https://www.google.com/" />
<title>google clicks</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">google clicks</td></tr>
</thead><tbody>
<tr>
<td>store</td>
<td>5</td>
<td>i</td>
</tr>
<tr>
<td>store</td>
<td>1</td>
<td>j</td>
</tr>
<tr>
<td>while</td>
<td>${i} &gt; ${j}</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>${j} +1</td>
<td>j</td>
</tr>
<tr>
<td>open</td>
<td>/</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=lst-ib</td>
<td>selenium ide open</td>
</tr>
<tr>
<td>click</td>
<td>name=btnK</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td></td>
<td>3000</td>
</tr>
<tr>
<td>pause</td>
<td></td>
<td>3000</td>
</tr>
<tr>
<td>refreshAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td></td>
<td>3000</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>id=pnnext</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td></td>
<td>3000</td>
</tr>
<tr>
<td>refreshAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td></td>
<td>3000</td>
</tr>
<tr>
<td>pause</td>
<td></td>
<td>3000</td>
</tr>
<tr>
<td>pause</td>
<td></td>
<td>3000</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Automation Testing: The Selenium IDE 'open' Command</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>/</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=lst-ib</td>
<td>manual testing</td>
</tr>
<tr>
<td>click</td>
<td>name=btnK</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td></td>
<td>3000</td>
</tr>
<tr>
<td>pause</td>
<td></td>
<td>3000</td>
</tr>
<tr>
<td>refreshAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td></td>
<td>3000</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=6</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=7</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td></td>
<td>3000</td>
</tr>
<tr>
<td>refreshAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td></td>
<td>3000</td>
</tr>
<tr>
<td>pause</td>
<td></td>
<td>3000</td>
</tr>
<tr>
<td>pause</td>
<td></td>
<td>3000</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Automation Testing: Manual Testing, The Art That Cannot Be Lost</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>endWhile</td>
<td></td>
<td></td>
</tr>
</tbody></table>
</body>
</html>

No comments :

Post a Comment