Last active
January 30, 2019 22:55
-
-
Save kyk4322/a2e31cbd8679f3378c8a662fb3e8a895 to your computer and use it in GitHub Desktop.
Selenium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DataTable dt = new DataTable(); | |
var header = driver.FindElement(By.CssSelector("#gridComponent > div.k-grid-header")); | |
foreach (var row in header.FindElements(By.TagName("tr"))) | |
{ | |
//Configure Number of Col and row | |
int cellIndex = 0; | |
string[] arr = new string[32]; | |
//Get Cell Data | |
foreach (var cell in row.FindElements(By.TagName("thead"))) | |
{ | |
//Number of Col Data Load | |
if (cellIndex <= 29) | |
{ | |
arr[cellIndex] = cell.Text; | |
} | |
else | |
continue; | |
cellIndex++; | |
} | |
dt.Columns.Add(arr); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment