Monday, July 8, 2019

Program to login into IBM Sterling and identify number of alerts raised to given username.

Program to login into IBM Sterling and identify number of alerts raised to given username.

Steps used below:

1. Open IE browser
2. Login into IBM Sterling using username & password
3. Click login button
4. Open Alert Console screen
5. Input username in the Search box
6. Click the Search button
7. Fetch number of alerts


from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.keys import Keys
import time

driver = webdriver.Ie()
driver.get("http://localhost:7001/smcfs/console/login.jsp")
time.sleep(1)

# Set value to Username
userName  = driver.find_element_by_name("UserId")
userName.send_keys("testuser")

# Set value to Password
passWord  = driver.find_element_by_name("Password")
passWord.send_keys("testuser")

# Submit the Form
submitForm  = driver.find_element_by_name("btnLogin")
submitForm.click()
time.sleep(1)

#Open Alert Console
adjust="http://localhost:7001/smcfs/console/exception.search"
driver.get(adjust)
time.sleep(1)

#Input - Username to whom the Alerts assigned
driver.find_element_by_name("xml:/Inbox/User/@Loginid").send_keys("mano")
driver.find_element_by_name("btnSearch").click()
time.sleep(1)

#Obtaining value from Retrived records count
records=driver.execute_script("return document.all['TotalNumRecs'].value")
print(records)

No comments:

Post a Comment

Popular Posts