diff --git a/CHANGES.rst b/CHANGES.rst index 9e7ffd8b2..3bfa40f43 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -20,7 +20,8 @@ Release Notes known browser and python version noncritical. Also added a noncritical case to the travis config for situations where testing is failing on travis for an unknown reason. - 'Capture Screenshot' now attempts to create its containing directory if the directory - specified in the filename does not exist. + specified in the filename does not exist. +- 'Choose File' now fails if the file doesn't exist [zephraph] - Added 'Get Window Position' and 'Set Window Position' keywords matching the diff --git a/src/Selenium2Library/keywords/_formelement.py b/src/Selenium2Library/keywords/_formelement.py index 1bc567a53..22065b393 100644 --- a/src/Selenium2Library/keywords/_formelement.py +++ b/src/Selenium2Library/keywords/_formelement.py @@ -175,7 +175,7 @@ def choose_file(self, locator, file_path): | Choose File | my_upload_field | /home/user/files/trades.csv | """ if not os.path.isfile(file_path): - self._info("File '%s' does not exist on the local file system" + raise AssertionError("File '%s' does not exist on the local file system" % file_path) self._element_find(locator, True, True).send_keys(file_path) diff --git a/test/acceptance/keywords/forms_and_buttons.txt b/test/acceptance/keywords/forms_and_buttons.txt index 3a3fdfb59..f615a6d7c 100644 --- a/test/acceptance/keywords/forms_and_buttons.txt +++ b/test/acceptance/keywords/forms_and_buttons.txt @@ -53,10 +53,10 @@ Click button created with