Tuesday, July 2, 2019

Automate Inbound Shipment Confirmation in IBM Sterling using Selenium Python

Automate Inbound Shipment Confirmation in IBM Sterling using Selenium Python


In IBM Sterling WMS with version 9x.  Below Selenium script using Python code to Automate the Inbound Shipment Confirmation process.

Steps involved in Inbound Shipment Confirmation:

1. Open Internet Explorer Browser (IBM Sterling works fine in this Browser)
2. Open Login Screen
3. Input Username and Password to Login
4. Click Login form
5. Open Inbound Shipment Console (Out of the Box screen)
6. Input Seller, Buyer
7. Click "Create Shipment" button to Create the Shipment
8. Scroll down bit to Input Item Details to create Item into the Shipment
9. Input ItemID, ProductClass and Quantity
10. Save the Shipment
11. Confirm the Shipment

Selenium Python Code:

from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.select import Select
import time

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

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

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

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

time.sleep(3)

#Open Inbound Shipment Console
driver.get("http://localhost:7001/smcfs/console/poshipment.detail?CurrentDetailViewID=YOMD7332")
driver.fullscreen_window

#Set Seller
setSeller  = driver.find_element_by_name("xml:/Shipment/@SellerOrganizationCode")
setSeller.send_keys("MODT")

#Set Buyer
setBuyer  = driver.find_element_by_name("xml:/Shipment/@BuyerOrganizationCode")
setBuyer.send_keys("KOMP")
time.sleep(3)

# Create Shipment
submitForm  = driver.find_element_by_xpath('//*[@type="button" and @class="button"]')
submitForm.click()
time.sleep(3)

# Scroll window
driver.execute_script("window.scrollTo(0, 200)")

#Add Item Details
driver.find_element_by_name("xml:/Shipment/ShipmentLines/ShipmentLine_1/@ItemID").send_keys("XXRXF00003")
Select(driver.find_element_by_name('xml:/Shipment/ShipmentLines/ShipmentLine_1/@ProductClass')).select_by_visible_text('Y001')
driver.find_element_by_name("xml:/Shipment/ShipmentLines/ShipmentLine_1/@Quantity").send_keys("10")

# Save Shipment
driver.find_element_by_xpath('//*[@type="button" and @class="button"]').click()
time.sleep(2)

# Confirm Shipment
driver.find_element_by_id("scbutton2").click()

No comments:

Post a Comment

Popular Posts