从硒中的ag-grid获取标头值

时间:2019-06-20 09:37:12

标签: selenium ag-grid

在我的网站上,我有一个ag-grid,并且仅在滚动时才加载数据;如何获取整个标头值并进行断言?

我尝试了如下操作,并且在第1页上运行良好,一旦滚动,我将获得新的标题。如何获得标题的第二部分?

String[] expectedCol={"Subject","Date Received","Status","Tag","Assigned To","Sender Name","Receiver Name"};
         List<WebElement> column=drvobj.findElements(By.xpath("//div [@class='ag-header-cell ag-header-cell-sortable']"));
            for (int i=0;i<column.size();i++)
                for (int j=0;j<expectedCol.length;j++){
                    System.out.println(column.get(i).getText());
                    System.out.println(expectedCol[j]);
                    if(column.get(i).getText().equals(expectedCol[j])){
                        System.out.println("Text Matched");
                    }
                    else{
                        System.out.println("Text Not Matched");
                    }
                    i++;
                }

0 个答案:

没有答案