Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Examples/BasicDataDrivenExample.robot
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
Library ExcelDataDriver ./test_data/BasicDemoData.xlsx capture_screenshot=Skip main_column_key=username
Test Template Validate user data template

*** Variables ***
${username} ${EMPTY}

*** Test Cases ***
Verify valid user '${username}' ${None} ${None} ${None}
Verify valid user '${username}' ${None} ${None} ${None} ${None}

*** Keywords ***
Validate user data template
[Arguments] ${username} ${password} ${email}
[Arguments] ${username} ${password} ${email} ${data_new_line}
Log ${username}
Log ${password}
Log ${email}
Log ${data_new_line}
Should Not Be Equal ${data_new_line} ${None}
Should Not Be Equal ${password} ${None}
2 changes: 2 additions & 0 deletions Examples/CustomParserExample.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Library CustomExcelParser/CustomExcelParser.py
Library ExcelDataDriver ./test_data/Custom_Template.xlsx main_column_key=sku custom_parser=CustomExcelParser capture_screenshot=OnFailed
Test Template Demo template

*** Variables ***
${sku} ${EMPTY}

*** Test Cases ***
Product promo price update for SKU '${sku}' ${None} ${None} ${None} ${None} ${None} ${None} ${None} ${None} ${None}
Expand Down
17 changes: 0 additions & 17 deletions Examples/SeleniumDataDrivenExample.robot

This file was deleted.

Binary file modified Examples/test_data/BasicDemoData.xlsx
Binary file not shown.
Binary file modified Examples/test_data/BasicNonTestResultColumnsMultipleSheet.xlsx
Binary file not shown.
10 changes: 8 additions & 2 deletions ExcelDataDriver/ExcelParser/ABCParserStrategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def parsing_major_column_indexs(self, ws):
found_default_column_indexs = True

if (cell.value is not None) and (cell.value not in self.DEFAULT_COLUMN_INDEXS) and (found_default_column_indexs is False):
field_name = str(cell.value).lower().strip().replace(" ", "_")
field_name = self._cleanup_fieldname(cell.value)
if field_name == self.main_column_key:
key_index_row = index + 1

Expand Down Expand Up @@ -87,7 +87,7 @@ def parsing_column_indexs(self, ws):
continue
for cell in row:
if (cell.value is not None) and (cell.value not in self.DEFAULT_COLUMN_INDEXS):
field_name = str(cell.value).lower().strip().replace(" ", "_")
field_name = self._cleanup_fieldname(cell.value)
ws_column_indexs[field_name] = column_index_from_string(coordinate_from_string(cell.coordinate)[0])
print(str(datetime.now())+': Optional : '+field_name + ' : ' + str(cell.coordinate) + ' : ' + str(column_index_from_string(coordinate_from_string(cell.coordinate)[0])))
break
Expand All @@ -107,3 +107,9 @@ def parse_test_data_properties(self, ws, ws_column_indexs):
print(str(datetime.now())+': Total test datas: ' + str(len(test_datas)))
return test_datas

def _cleanup_fieldname(self, field_name):
field_name = str(field_name).lower().strip().replace(" ", "_")
field_name = field_name.replace("\r", "_")
field_name = field_name.replace("\n", "_")
field_name = field_name.replace("__", "_")
return field_name