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