Exemple #1
0
        public void HtmlTable_FindRowUsingTableWithoutRowHeaders_Succeeds()
        {
            WebPage           bWin = WebPage.Launch(CurrentDirectory + "/TestHtmlPage.html", "A Test");
            EnhancedHtmlTable tbl  = bWin.Get <EnhancedHtmlTable>("id=calcWithOutHeaders");

            tbl.FindRowAndClick(2, "9", EnhancedHtmlTableSearchOptions.NormalTight);
            Assert.AreEqual("9", tbl.GetCellValue(2, 2).Trim());
            bWin.Close();
        }
Exemple #2
0
        public void HtmlTable_GetCellValueUsingTableWithTHInTBODY_Succeeds()
        {
            //Arrange
            using (var tempFile = new TempFile(
                       @"<html>
    <head>
        <title>test</title>
    </head>
    <body>
        <table id=""tableId"" border=""1"">
            <tbody>
                <tr>
                    <th>Lun</th>
                    <th>Used Space</th>
                    <th>Free Space</th>
                    <th>Usage %</th>
                    <th>&nbsp;</th>
                </tr>
                <tr>
                    <td>LUN_04</td>
                    <td>26534605227</td>
                    <td>15405750418</td>
                    <td>
                        <dl>
                            <dd>
                                <dl>
                                    <dd>
                                        <span>64.27%</span>
                                    </dd>
                                </dl>
                            </dd>
                        </dl>
                    </td>
                    <td></td>
                </tr>
            </tbody>
        </table>
    </body>
</html>"))
            {
                WebPage.Launch(tempFile.FilePath);
                var window = new WebPage("test");

                EnhancedHtmlTable table = window.Get <EnhancedHtmlTable>("id=tableId");

                //Act
                table.FindRowAndClick(0, "LUN_04", EnhancedHtmlTableSearchOptions.NormalTight);

                //Assert
                Assert.AreEqual("LUN_04", table.GetCellValue(1, 0).Trim());

                window.Close();
            }
        }