blob: ad11b11522424a028e11f2fc2174b7760bc7a718 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001from Selenium2Library import Selenium2Library
2from selenium.webdriver.common.keys import Keys
3import time
4
5class 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