I have this table, and I need to verify the column names first then the second row's values. I'm new to Python and I tried to check on other site such as this: https://www.tutorialspoint.com/how-to-get-all-the-values-of-a-particular-row-based-on-a-condition-in-a-worksheet-in-selenium-with-python but do we have something like an automatic indexing for checking of values? One approach is I can save the column names in an array and add assertion to check if they are equal. But how do I get the column names?
For the column names, I have to verify if it has the same data in the array:
columnNames:["Column 1", "Column 2", "Column 3", "Column 4", "Column 5", "Column 6", "Column 7", "Column 8", "Column 9", "Column 10", "Column 11"]
For the value row I need to know how do I specify index but automatic? Or should I make it like row[2].value? But I'm not sure. :/ I'm so confused...
I only currently have this one :/
columnNames: ["Column 1", "Column 2", "Column 3", "Column 4", "Column 5", "Column 6", "Column 7", "Column 8", "Column 9", "Column 10", "Column 11"]
activeWorksheet = excelTitle.active
for item in range(1,activeWorksheet.max_row+1):
global excelColumnNames
excelColumnNames.append(activeWorksheet.cell(row=item))
