- quake004
- Posts : 5
Join date : 2015-03-24
Copy contents of table to a list on another page
Tue Mar 24, 2015 10:01 pm
I'm trying to loop through the elements of a table to store each of them in a variable and then go to another page and paste the contents off all the variables, one per line, but I'm getting an error in the loop:
- Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="es.magiccardmarket.eu/" />
<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>es.magiccardmarket.eu/?mainPage=browseUserProducts&idCategory=1&idUser=13786</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>1</td>
<td>x</td>
</tr>
<tr>
<td>label</td>
<td>target1</td>
<td></td>
</tr>
<tr>
<td>storeTable</td>
<td>//div[@id='siteContents']/div[2]/div[2]/div/form/table.${x}.2</td>
<td>card{$x}</td>
</tr>
<tr>
<td>store</td>
<td>new Number{${x} + 1}</td>
<td>x</td>
</tr>
<tr>
<td>gotoIf</td>
<td>${x} < 31</td>
<td>target1</td>
</tr>
<tr>
<td>open</td>
<td>quackit.com/html/codes/html_text_box_code.cfm</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>1</td>
<td>x</td>
</tr>
<tr>
<td>store</td>
<td>1</td>
<td>y</td>
</tr>
<tr>
<td>label</td>
<td>target2</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=comments</td>
<td>{$card{$x}}<br /></td>
</tr>
<tr>
<td>store</td>
<td>new Number{${x} + 1}</td>
<td>x</td>
</tr>
<tr>
<td>store</td>
<td>new Number{${y} + 1}</td>
<td>y</td>
</tr>
<tr>
<td>gotoIf</td>
<td>${y} < 30</td>
<td>target2</td>
</tr>
</tbody></table>
</body>
</html>
- quake004
- Posts : 5
Join date : 2015-03-24
Re: Copy contents of table to a list on another page
Wed Mar 25, 2015 7:12 pm
I found some errors. Know the only thing that last is to type the value in a variable like ${card${x}}
- Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="eu.magiccardmarket.eu/" />
<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>eu.magiccardmarket.eu/?mainPage=browseUserProducts&idCategory=1&idUser=13786</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>1</td>
<td>x</td>
</tr>
<tr>
<td>label</td>
<td>target1</td>
<td></td>
</tr>
<tr>
<td>storeTable</td>
<td>//div[@id='siteContents']/div[2]/div[2]/div/form/table.${x}.2</td>
<td>card${x}</td>
</tr>
<tr>
<td>storeEval</td>
<td>new Number(${x}) + 1</td>
<td>x</td>
</tr>
<tr>
<td>gotoIf</td>
<td>storedVars['x'] < 31</td>
<td>target1</td>
</tr>
<tr>
<td>open</td>
<td>quackit.com/html/codes/html_text_box_code.cfm</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>1</td>
<td>x</td>
</tr>
<tr>
<td>store</td>
<td>1</td>
<td>y</td>
</tr>
<tr>
<td>label</td>
<td>target2</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=comments</td>
<td>${card${x}}<br /></td>
</tr>
<tr>
<td>storeEval</td>
<td>new Number(${x}) + 1</td>
<td>x</td>
</tr>
<tr>
<td>storeEval</td>
<td>new Number(${y}) + 1</td>
<td>y</td>
</tr>
<tr>
<td>gotoIf</td>
<td>storedVars['y'] < 31</td>
<td>target2</td>
</tr>
</tbody></table>
</body>
</html>
- ccoxMaster
- Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO
Re: Copy contents of table to a list on another page
Sat Mar 28, 2015 5:53 am
Is this all one script? I loaded it and see you are trying to open a new URL with the same baseURL as the next step. This is obviously failing since the URL is appended making it incorrect. To fix this open the script in a text editor such as Notepad. Change the line href="eu.magiccardmarket.eu/" to href="". You should also update your urls to have http:// in front of them. I did this and everything passed for me.
- Download Excel from web and copy contents from that excel and paste it to another excel
- Selecting list of names on web page
- It is possible to find list of all URL's exist in any web page in selenium ide
- How to select multiple item from the web list and drop down list in Webdriver
- Highlight and copy text
Permissions in this forum:
You cannot reply to topics in this forum