Skip to content

Commit 3bce11b

Browse files
committed
Add proper error when can't select data based on given condition
1 parent 8ea9cb1 commit 3bce11b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ExcelDataDriver/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from ExcelDataDriver.Config.CaptureScreenShotOption import CaptureScreenShotOption
4040

4141

42-
__version__ = '1.1.5'
42+
__version__ = '1.1.6'
4343

4444

4545
class ExcelDataDriver:
@@ -579,7 +579,10 @@ def select_reference_data_based_on_condition(self, alias_name, condition):
579579
sheet_name string
580580
properties_list dictionary: access to excel property with lower case and use _ instead of space
581581
"""
582-
self.reference_data[alias_name]['selected'] = next(data for data in self.reference_data[alias_name]['data'] if eval(condition))
582+
try:
583+
self.reference_data[alias_name]['selected'] = next(data for data in self.reference_data[alias_name]['data'] if eval(condition))
584+
except Exception:
585+
raise Exception("Can't select reference data based on condition "+str(condition))
583586

584587
@keyword
585588
def get_selected_reference_data_property(self, alias_name, property_name):

0 commit comments

Comments
 (0)