Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sample of testcase of Selenium IDE to automate the operation
<?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://connpass.com/" />
<title>test</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">test</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/explore</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>1</td>
<td>pageCount</td>
</tr>
<tr>
<td>storeEval</td>
<td>var date = new Date();Date.parse(date.getFullYear() + &quot;/&quot; + (date.getMonth() + 1)&nbsp;&nbsp;+ &quot;/&quot; + 1);</td>
<td>thisMonthDate</td>
</tr>
<tr>
<td>echo</td>
<td>${thisMonthDate}</td>
<td></td>
</tr>
<tr>
<td>storeText</td>
<td>//div[@id='main']/div/div[10]/div/div/p[2]</td>
<td>createDateContent</td>
</tr>
<tr>
<td>echo</td>
<td>${createDateContent}</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars[&quot;createDateContent&quot;].match(/\d{4}\/\d{2}\/\d{2}/);</td>
<td>createDateString</td>
</tr>
<tr>
<td>echo</td>
<td>${createDateString}</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>Date.parse(storedVars[&quot;createDateString&quot;]);</td>
<td>createDate</td>
</tr>
<tr>
<td>echo</td>
<td>${createDate}</td>
<td></td>
</tr>
<tr>
<td>while</td>
<td>storedVars[&quot;createDate&quot;] &gt; storedVars[&quot;thisMonthDate&quot;]</td>
<td></td>
</tr>
<tr>
<td>storeText</td>
<td>//div[@id='main']/div/div[10]/div/div/p[2]</td>
<td>createDateContent</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars[&quot;createDateContent&quot;].match(/\d{4}\/\d{2}\/\d{2}/);</td>
<td>createDateString</td>
</tr>
<tr>
<td>storeEval</td>
<td>Date.parse(storedVars[&quot;createDateString&quot;]);</td>
<td>createDate</td>
</tr>
<tr>
<td>echo</td>
<td>${createDate} + &quot; vs &quot; + ${thisMonthDate}</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=次へ&gt;&gt;</td>
<td></td>
</tr>
<tr>
<td>getEval</td>
<td>storedVars[&quot;pageCount&quot;]++;</td>
<td></td>
</tr>
<tr>
<td>endWhile</td>
<td></td>
<td></td>
</tr>
<tr>
<td>getEval</td>
<td>alert(&quot;finished. pageCount =&nbsp;&nbsp;&quot; + ${pageCount});</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.