tags:

views:

424

answers:

1

If I have a table in Selenium and I want to get a specific cell in a row, what would be the relevant method call?

What I am confused about is the specific value I am looking for comes up more than once in the table so how do I know which value is found?

Furthermore, how can I pass credentials via basic auth?

Thanks

+3  A: 

To get a specific cell using selenium C# its selenium.GetTable("table.1.2") where table is the name of the table, 1 is the row and 2 is the cell.

e.g.

    [Test]
    public void TableTest()
    {
        try
        {
            Assert.AreEqual("value that should be in the cell", selenium.GetTable("table.1.2"));
        }
        catch (AssertionException e)
        {
            verificationErrors.Append(e.Message);
        }
    }

To get around the basic auth situation you will need to use http://username:[email protected] as the url where username and password will get you through to the page but more and more browsers are starting to block this so beware. Where I work we avoid this scenario.

AutomatedTester
I tried that approach, no luck.
blade1
That is, with the basic auth problem.
blade1
BTW, is "table" meant to be the name of the table?
blade1
@blade1 - yes it is.
AutomatedTester