How to use table commands "waitForTable" and "storeTable" in selenium IDE

"waitForTable" and "storeTable" are html table related commands. Both have different functions. As name suggest, "waitForTable" is useful to waiting for table data and we can use "storeTable" to store table data in to variable. You can take a look at other "store" Commands and "waitFor" Commands for your
reference. Supposing you have a table and you want to store data of specific column and row then you need to use "storeTable" command.

Let we take one example for "waitForTable" and "storeTable" commands.

"waitForTable" Command
"waitForTable" command will wait for table data for targeted row and column. Selenium will not execute next command until targeted data not appears in table. It will return '[error] Timed out after 30000ms' if targeted text will not appear within default timeout and then selenium will go for executing next command.

"storeTable" Command
"storeTable" command will store data of targeted cell of table. Look at the bellow given example for "waitForTable" and "storeTable" commands.

New Test
waitForTablecss=div > table.2.5Ready!
storeTablecss=div > table.0.21strow3rdcolumn
storeTablecss=div > table.2.43rdrow5thcolumn

In above given example, "waitForTable" command will wait for text 'Ready!' in 3rd row and 6th column of targeted table. Here 'css=div > table.2.5' means 3rd row and 6th column of table. "storeTable" command will retrieve data from 1st raw and 3rd column of table and store it in variable '1strow3rdcolumn'.

You can try more examples on any software web application page for more clarification.

No comments:

Post a Comment