How do I retrieve the text in a table column using Selenium RC? How do I retrieve the text in a table column using Selenium RC? selenium selenium

How do I retrieve the text in a table column using Selenium RC?


it would be

string value1 = selenium.getTable("table.1.2");string value2 = selenium.getTable("table.2.2");

and so on.

The help text for getTable is

getTable(tableCellAddress) Arguments:

  • tableCellAddress - a cell address, e.g. "foo.1.4"

    Returns: the text from the specified cell

    Gets the text from a cell of a table. The cellAddress syntax tableLocator.row.column, where row and column start at 0.


Check this,

            int i =1;       while(selenium.isElementPresent("//table/tbody/tr["+i+"]/td[2]")){           System.out.println(selenium.getText("//table/tbody/tr["+i+"]/td[2]"));           i++;       }

Result will contain all the values listed.Hope it helps!!!


String value1 = selenium.getText("//tr[1]/td[1]/strong[contains(text(), Label1:')]/../../td[2]");