eh552t | 7edf080 | 2018-07-30 12:48:48 +0200 | [diff] [blame] | 1 | from Selenium2Library import Selenium2Library |
| 2 | from selenium.webdriver.common.keys import Keys |
| 3 | import time |
| 4 | |
| 5 | class CustomSeleniumLibrary(Selenium2Library): |
| 6 | def insert_into_prompt(self, text): |
| 7 | alert = None |
| 8 | try: |
| 9 | time.sleep(5) |
| 10 | listOfFields = text.split(" ") |
| 11 | allInOneString="" |
| 12 | for temp in listOfFields: |
| 13 | allInOneString=allInOneString+temp+Keys.TAB |
| 14 | |
| 15 | alert= self._current_browser().switch_to_alert() |
| 16 | alert.send_keys(allInOneString) |
| 17 | except WebDriverException: |
| 18 | raise RuntimeError('There were no alert') |
| 19 | |
| 20 | |