Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Copy contents of table to a list on another page

View previous topic View next topic Go down

Copy contents of table to a list on another page

Post by quake004 on 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

Back to top Go down

Re: Copy contents of table to a list on another page

Post by quake004 on 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>

quake004

Posts : 5
Join date : 2015-03-24

Back to top Go down

Re: Copy contents of table to a list on another page

Post by ccox on 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.

ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 31
Location : Denver, CO

Back to top Go down

Re: Copy contents of table to a list on another page

Post by Sponsored content Today at 8:09 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum