Skip to content

Instantly share code, notes, and snippets.

@sr3d
Created September 15, 2010 01:17
Show Gist options
  • Save sr3d/580085 to your computer and use it in GitHub Desktop.
Save sr3d/580085 to your computer and use it in GitHub Desktop.
<?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.kissmetrics.com/" />
<title>kiss metric 2</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">kiss metric 2</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/report/5614</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//div[@id='tab-contents']/div[1]/div/div[2]/table/thead/tr[2]/th[1]/select</td>
<td>label=Referrer</td>
</tr>
<tr>
<td>setSpeed</td>
<td>1000</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//p[@id='showing']/select</td>
<td>label=50</td>
</tr>
<tr>
<td>setSpeed</td>
<td>setSpeed(0)</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>true</td>
<td>hasNext</td>
</tr>
<tr>
<td>getEval</td>
<td>with(this.browserbot.getUserWindow()) { window.urls = []; window.totals = [], window.conversions = [], process = function(){ $$('td.left a').each(function(a) {&nbsp;&nbsp;window.urls.push(a.href) } );$$('td.left').getNext().each( function(td) { window.totals.push(td.innerHTML) } );$$('td.final_step').each( function(td) { window.conversions.push(td.innerHTML) }); } }</td>
<td></td>
</tr>
<tr>
<td>while</td>
<td>storedVars.hasNext</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//p[@id='showing']/a[2]</td>
<td></td>
</tr>
<tr>
<td>getEval</td>
<td>with(this.browserbot.getUserWindow()) { process() }</td>
<td></td>
</tr>
<tr>
<td>setSpeed</td>
<td>1500</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//p[@id='showing']/a[2]</td>
<td></td>
</tr>
<tr>
<td>setSpeed</td>
<td>setSpeed(0)</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>javascript{ with(this.browserbot.getUserWindow()) {&nbsp;&nbsp;$$('#showing a')[1].className != 'disabled' } }</td>
<td>hasNext</td>
</tr>
<tr>
<td>endWhile</td>
<td></td>
<td></td>
</tr>
<tr>
<td>getEval</td>
<td>with(this.browserbot.getUserWindow()) { console.log(window.urls) }</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
@sr3d
Copy link
Author

sr3d commented Sep 15, 2010

run
console.log( urls )
inside firebug. The results should be a CSV list that can be saved into a file. Do the same thing for totals and conversions

console.log( totals )
console.log( conversions )

Save the file as urls.csv, then get to terminal, run

tr "," "\n" < urls.csv > urls1.csv

Repeat for totals.csv and conversions.csv. Now the files should be importable into Excel or Google Spreadsheet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment