"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 | ||
Command | Target | Value |
open | http://only-testing-blog.blogspot.com/2013/10/table.html | |
waitForTable | css=div > table.2.5 | Ready! |
storeTable | css=div > table.0.2 | 1strow3rdcolumn |
echo | ${1strow3rdcolumn} | |
storeTable | css=div > table.2.4 | 3rdrow5thcolumn |
echo | ${3rdrow5thcolumn} |
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