Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- .|'''| '||\ /||`.|'''| '||\ /||`.|''''|,'||'''|.'|| ||`'|| '||''''|
- || ||\\.//|| || ||\\.//|| || || || || || || || || .
- `|'''|, || || `|'''|, || || || || || || || || || ||'''|
- . || || || . || || || || || || || || || || ||
- |...|'.|| ||. |...|' .|| ||.`|....|'.||...|' `|...|' .||...|.||....|
- || .''',
- '|| | |
- \\ // || | |
- \\// || | |
- \/...||...`,,,'
- (Font: 'fender')
- This module is to be used to interact with the Zimmer Biomet Surgery Management System
- This module is coded entirely using Python 3.5 and Anaconda
- and edited using Spyder2/Spyder3. This program is Developed and created by Ian Doarn
- This is being developed on a consistant bases!
- WARNING!
- PLEASE Do not make edits to any of the code in this file unless you know 100% what you are doing.
- Breaking this module will cause a complete break of the physical application.
- Requests for features must be sent to Ian Doarn
- Ian.Doarn@zimmerbiomet,com
- ian.doarn@zbsaleslogistics.com
- """
- #import all needed modules
- import logging
- from sys import stderr, stdout
- import xlrd
- import os
- import ctypes
- from selenium import webdriver
- from selenium.webdriver.common.keys import Keys
- from selenium import *
- from selenium.webdriver.common.action_chains import ActionChains
- from selenium.webdriver.common.by import By
- from selenium.webdriver.support.ui import WebDriverWait
- from selenium.webdriver.support import expected_conditions as EC
- from selenium.common.exceptions import NoSuchElementException
- from datetime import date
- from datetime import timedelta
- import time
- from time import sleep
- def yesterday():
- # Get today.
- today = date.today()
- # Subtract timedelta of 1 day.
- yesterday = today - timedelta(days=1)
- return yesterday
- from tkinter import *
- #start logging module this will record all actions and record them for debugging purposes!
- #Start classes
- #define variables to call for automation process
- #this will help run faster so the code is shorter in the main sections
- """
- Used to read cells from an excel file one at a time
- Use:
- 1) Call the class with new()
- 2) Call new.var() to clear variables and start at top of document
- 3) Call new.stp() to begin process
- 4) Call new.nextp() until finished
- """
- #########################################################################
- #########################################################################
- class GLOBAL_BEGIN(object):
- def __init__(self):
- self.SMS = calls_sms()
- #########################################################################
- #########################################################################
- # main class for SMS interaction
- class calls_sms():
- def __init__(self, logger=None): #sets variables up and inital value NULL
- self.w = None
- self.variable = None
- self.value = None
- self.default_int = 0 #
- self.default_string = None #These are for empty feilds
- self.default = None #
- self.w = 2
- #open EXCEL
- self.file_location = os.path.expanduser(os.sep.join(["~","Desktop","mutate.xls"])) #finds home directorry
- self.workbook = xlrd.open_workbook(self.file_location)
- self.sheet = self.workbook.sheet_by_index(0)
- logging.basicConfig(filename='server-sms_automation.err.log',level=logging.DEBUG)
- self.logging = logging
- self.logging.debug('Program launched @ '+str(date.today())+'')
- self.logging.debug('===========================================')
- calls_sms.beginprod(self)
- calls_sms.nextp(self) #called here first to avoid None or column header as input
- def output_file(self):
- f = open("mutate_output.txt","a")
- f.write(str(self.text))
- self.text = None
- f.close()
- def session_output_file(self):
- f = open("session_log.txt","a")
- f.write(str(self.text))
- self.text = None
- f.close()
- def slay(self):
- self.driver.quit()
- self.slaystring = 'Disconnected from Session '+str(date.today())+''
- self.logging.debug('Disconnecting from Session '+str(date.today())+'')
- self.text ='Disconnecting from Session '+str(date.today())+'\n'
- calls_sms.session_output_file(self)
- def beginprod(self):
- self.w = 2
- calls_sms.stp(self)
- self.logging.debug('Openning EXCEL file')
- def stp(self):
- for row in range(self.sheet.nrows):
- row = self.sheet.row_values(self.w)
- self.variabledashed = row[6]
- self.variable = row[7] #Product number
- self.edi = row[8] #EDI number
- self.partdesc = row[9] #description
- self.lotnumber = row[10] #lot number
- self.serial = row[11] #serial
- self.casenumber = row[12]
- self.logging.debug('new product#: '+str(self.variable)+'')
- def nextp(self):
- self.w += 1
- calls_sms.stp(self)
- def emptyexcelvars(self):
- self.variabledashed = None #Product number
- self.variable = None #EDI number
- self.partdesc = None #Description
- self.lotnumber = None #lot number
- self.serialnumber = None #serialized number
- self.casenumber = None #Case number
- self.logging.debug('Variables emptied')
- # #attempt #2 use this when a csv file is your only option
- # def dic(self):
- # self.dic = self.d.get('val')
- # self.a = self.dic.get('a'+str(self.w)+'')
- # self.dicentry = str(self.a)
- #
- # def nextdic(self):
- # self.w += 1
- #abbreviations for later use
- def var(self): #must be called var, driver is not defined till launch call
- self.xpath = self.driver.find_element_by_xpath
- self.classname = self.driver.find_element_by_class_name
- self.css = self.driver.find_element_by_css_selector
- #Open IE driver and new IE window
- def launch(self):
- self.text = 'Program launched @ '+str(date.today())+'\n'
- calls_sms.session_output_file(self)
- self.launchstring = 'Launching Webdriver.IE'
- self.driver = webdriver.Chrome()
- self.driver.get("https://www.zimmersms.com/")
- self.logging.debug('Connected to SMS on '+str(date.today())+'')
- self.launchstring = 'Connected to SMS on '+str(date.today())+''
- #Open IE driver and new IE window in SMS Test inviorment
- def launch_qa(self):
- self.text = 'QA Program launched @ '+str(date.today())+'\n'
- calls_sms.session_output_file(self)
- self.launchstring = 'Launching Webdriver.IE'
- self.driver = webdriver.Chrome()
- self.driver.get("http://qa.zimmersms.com/")
- self.logging.debug('Connected to SMS QA on '+str(date.today())+'')
- self.launchstring = 'Connected to SMS QA on '+str(date.today())+''
- def login(self):
- self.username = self.classname("GJCH5BMD1C")
- self.password = self.xpath("//input[@type='password']")
- try:
- self.username.send_keys("doarni")
- self.password.send_keys("Zimmer1")
- self.log_in = self.xpath("//*[@class='GJCH5BMI-C']").click()
- self.logging.debug('Connected to SMS @ '+str(date.today())+' User: doarni')
- except:
- os.system('python sms_generic_err.py')
- self.logging.debug('FAILED LOGIN '+str(date.today())+' User: doarni')
- self.text = 'FAILED LOGIN '+str(date.today())+' User: doarni\n'
- calls_sms.session_output_file(self)
- pass
- time.sleep(3)
- self.loginstringsuccess = 'Successfully Logged In'
- calls_sms.check_site(self)
- """
- ```````````````
- Addaptive Wait Functions
- ```````````````
- Since SMS loads elements dynamically, customized wait functions need to be created.
- Hopefully these can eliminated time.sleep and add a large level of flexablility
- Useage:
- Set up the classname wait as loop = "classname" and then call the function self.wait_for_class(loop)
- set up the css wait as loop = "tbody tr td div.GJCH5BMN2C" and call the function self.wait_for_css(loop)
- set up the xpath wait as loop = "//div[@class='GJCH5BMHEF' and text()=' Stock ']" and call the function self.wait_for_xpath(loop)
- SMS does not have ID's defined.
- """
- def wait_for_class(self, loop):
- for x in range(0, 21):
- try:
- self.classname(loop)
- break
- except NoSuchElementException:
- time.sleep(1)
- if x == 20:
- print('timed out...')
- break
- break
- def wait_for_css(self, loop):
- for x in range(0, 21):
- try:
- self.css(loop)
- break
- except NoSuchElementException:
- time.sleep(1)
- if x == 20:
- print('timed out...')
- break
- break
- def wait_for_xpath(self, loop):
- for x in range(0, 21):
- try:
- self.xpath(loop)
- break
- except NoSuchElementException:
- time.sleep(1)
- if x == 20:
- print('timed out...')
- break
- break
- def wait_for_css_paybackline(self, loop):
- for x in range(0, 10):
- try:
- self.css(loop)
- break
- except NoSuchElementException:
- time.sleep(1)
- if x == 20:
- print('timed out...')
- break
- break
- """
- #defing buttons/tab navigation for various screens
- """
- """
- #Stock tab screen
- These are the various functions and subfunctions to use the stock tab.
- You be propted to select the stock tab when you start an assignment
- Special logic will be written later to read the table and read across it
- NEVER USE DYNAMIC VARIABLES IN PYTHON!
- DON'T YOU DARE!
- """
- def stock_tab(self):
- #Only call when on stock tab
- try:
- loop = "//div[@class='GJCH5BMHEF' and text()=' Stock ']"
- self.wait_for_xpath(loop)
- self.stock = self.xpath(loop).click()
- except:
- try:
- loop = "//div[@class='GJCH5BMHEF' and text()='Stock ']"
- self.wait_for_xpath(loop)
- self.stock = self.xpath(loop).click()
- except:
- os.system('python sms_generic_err.py')
- pass
- def stock_tab_prd_select(self):
- #opens prod chooser
- loop = "//span[@class='GJCH5BMKU' and text()='Select']"
- self.wait_for_xpath(loop)
- self.stockselect = self.xpath(loop).click()
- def stock_searchbtn(self):
- loop = "//*[@class='GJCH5BMJV']"
- self.wait_for_xpath(loop)
- self.stocksearch = self.xpath(loop)
- self.stocksearch.click()
- def stock_tab_prd_clear(self):
- #clears product
- loop = "//span[@class='GJCH5BMKU' and text()='Clear']"
- self.wait_for_xpath(loop)
- self.stockclear = self.xpath(loop).click()
- def stock_resetbtn(self):
- #stock reset button
- loop = "//span[@class='GJCH5BMKU' and text()='Reset']"
- self.wait_for_xpath(loop)
- self.stockreset = self.xpath(loop).click()
- #Stock Tab Ribbion Links
- def stock_getlabels(self):
- #Get Labels
- self.getlabels = self.xpath("//span[@class='GJCH5BMKU' and text()='Get Labels']").click()
- def stock_AutoSourceInvalidKits(self):
- #Auto Source Invlaid Kits
- self.AutoSourceInvalidKits = self.xpath("//span[@class='GJCH5BMKU' and text()='Auto Source Invalid Kits']").click()
- def stock_transfer(self):
- # Transfer
- self.transf_stocktab = self.xpath("//span[@class='GJCH5BMKU' and text()='Transfer']").click()
- def stock_sourcetoorder(self):
- #source to order
- self.sorucetoorder = self.xpath("//span[@class='GJCH5BMKU' and text()='Source To Order']").click()
- def stock_rewritelot(self):
- #rewrite lot
- self.rewritelot = self.xpath("//span[@class='GJCH5BMKU' and text()='Rewrite Lot']").click()
- def stock_mutate(self):
- #Mutate Stock to territory
- self.mutate = self.xpath("//span[@class='GJCH5BMKU' and text()='Mutate']").click()
- def quanitiy_mutate(self):
- self.actions = None
- self.quanitiy_mutate = self.xpath("//div[@class='GJCH5BMN2C']/div[2]/div/table/tbody/tr[1]/td/table/tbody/tr[2]/td[2]")
- self.quanitiy_mutate.click()
- self.actions = ActionChains(self.driver)
- self.clickinto = self.actions.move_to_element(self.quanitiy_mutate).send_keys('1').perform()
- self.actions = None #MUST BE CLEAR FOR THIS FUNCTION TO WORK!
- def allavail(self):
- self.allavail = self.css("html body div.gwt-PopupPanel div.popupContent div div table tbody tr td div.GJCH5BMN2C div.GJCH5BML2C div table tbody tr td.GJCH5BMIQD table tbody tr td.GJCH5BMCS div.GJCH5BMMVC span.GJCH5BMPVC").click()
- def notestring(self):
- self.actions = None
- self.notestring = self.xpath("//div[@class='GJCH5BMN2C']/div[2]/div/table/tbody/tr[1]/td/table/tbody/tr[4]/td[2]")
- self.notestring.click()
- self.actions = ActionChains(self.driver)
- self.clickinto = self.actions.move_to_element(self.notestring).send_keys('Mutated by bot '+str(date.today())).perform()
- self.actions = None #MUST BE CLEAR FOR THIS FUNCTION TO WORK!
- def mutate_cancel(self):
- self.mutuate_cancel = self.css("html body div.gwt-PopupPanel div.popupContent div div table tbody tr td div.GJCH5BMN2C div.GJCH5BML2C div table tbody tr td.GJCH5BMJQD table tbody tr td.GJCH5BMKQD span.GJCH5BMFYC div.GJCH5BMI-C div.GJCH5BMJYC.GJCH5BMGYC").click()
- def mutate_save(self):
- self.mutate_save = self.css("html body div.gwt-PopupPanel div.popupContent div div table tbody tr td div.GJCH5BMN2C div.GJCH5BML2C div table tbody tr td.GJCH5BMJQD table tbody tr td span.GJCH5BMJ-C div.GJCH5BMM0C div.GJCH5BMN-C.GJCH5BMK-C").click()
- #Stock Menu Interaction
- """
- Click check boxes
- """
- def box_biometonly(self):
- self.biometonly = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(1) > div:nth-child(3) > div.GJCH5BMNV > table > tbody > tr > td.GJCH5BMBS > div > span").click()
- def box_explode(self):
- self.explode = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(1) > div:nth-child(4) > div.GJCH5BMNV > table > tbody > tr > td.GJCH5BMBS > div > span").click()
- def box_DC(self):
- self.DC = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(1) > div:nth-child(9) > div.GJCH5BMNV > table > tbody > tr:nth-child(1) > td.GJCH5BMBS > div > span").click()
- def box_Site(self):
- self.Site = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(1) > div:nth-child(9) > div.GJCH5BMNV > table > tbody > tr:nth-child(2) > td.GJCH5BMBS > div > span").click()
- def box_Account(self):
- self.Account = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(1) > div:nth-child(9) > div.GJCH5BMNV > table > tbody > tr:nth-child(3) > td.GJCH5BMBS > div > span").click()
- def box_Rep(self):
- self.Rep = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(1) > div:nth-child(9) > div.GJCH5BMNV > table > tbody > tr:nth-child(4) > td.GJCH5BMBS > div > span").click()
- def box_Team(self):
- self.Team = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(1) > div:nth-child(9) > div.GJCH5BMNV > table > tbody > tr:nth-child(5) > td.GJCH5BMBS > div > span").click()
- def box_Piece(self):
- self.Piece = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(2) > div.GJCH5BMNV > table > tbody > tr:nth-child(1) > td.GJCH5BMBS > div > span").click()
- def box_Kit(self):
- self.Kit = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(2) > div.GJCH5BMNV > table > tbody > tr:nth-child(2) > td.GJCH5BMBS > div > span").click()
- def box_Invalid_Kit(self):
- self.Invalid_Kit = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(2) > div.GJCH5BMNV > table > tbody > tr:nth-child(3) > td.GJCH5BMBS > div > span").click()
- def box_Component(self):
- self.Component = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(2) > div.GJCH5BMNV > table > tbody > tr:nth-child(4) > td.GJCH5BMBS > div > span").click()
- def box_ZDI(self):
- self.ZDI = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(3) > div.GJCH5BMNV > table > tbody > tr:nth-child(1) > td.GJCH5BMBS > div > span").click()
- def box_Conisgnment(self):
- self.Consignment = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(3) > div.GJCH5BMNV > table > tbody > tr:nth-child(2) > td.GJCH5BMBS > div > span").click()
- def box_Loaner_Pool(self):
- self.Loaner_Pool = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(3) > div.GJCH5BMNV > table > tbody > tr:nth-child(3) > td.GJCH5BMBS > div > span").click()
- def box_Loaner_Pool_NS(self):
- self.Loaner_Pool_NS = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(3) > div.GJCH5BMNV > table > tbody > tr:nth-child(4) > td.GJCH5BMBS > div > span").click()
- def box_Central_Inventory(self):
- self.Central_Inventory = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(3) > div.GJCH5BMNV > table > tbody > tr:nth-child(5) > td.GJCH5BMBS > div > span").click()
- def box_Trauma_Shared_pool(self):
- self.Trauma_Shared_Pool = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(3) > div.GJCH5BMNV > table > tbody > tr:nth-child(6) > td.GJCH5BMBS > div > span").click()
- def box_Institute(self):
- self.Institute = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(3) > div.GJCH5BMNV > table > tbody > tr:nth-child(7) > td.GJCH5BMBS > div > span").click()
- def box_Distributor(self):
- self.Distributor_Owned = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(3) > div.GJCH5BMNV > table > tbody > tr:nth-child(8) > td.GJCH5BMBS > div > span").click()
- def box_Bin(self):
- self.Bin = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(4) > div.GJCH5BMNV > table > tbody > tr:nth-child(1) > td.GJCH5BMBS > div > span").click()
- def box_Loan(self):
- self.Loan = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(4) > div.GJCH5BMNV > table > tbody > tr:nth-child(2) > td.GJCH5BMBS > div > span").click()
- def box_Package(self):
- self.Package = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(4) > div.GJCH5BMNV > table > tbody > tr:nth-child(3) > td.GJCH5BMBS > div > span").click()
- def box_ZSMS_Hold(self):
- self.ZSMS_Hold = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(6) > div.GJCH5BMNV > table > tbody > tr:nth-child(1) > td.GJCH5BMBS > div > span").click()
- def box_Missing_Exp(self):
- self.Missing_Exp = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(7) > div.GJCH5BMNV > table > tbody > tr > td.GJCH5BMBS > div > span").click()
- def box_Sterile(self):
- self.Sterile = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(8) > div.GJCH5BMNV > table > tbody > tr > td.GJCH5BMBS > div > span").click()
- def box_Lot_rewrite(self):
- self.Lot_rewrite = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(9) > div.GJCH5BMNV > table > tbody > tr > td.GJCH5BMBS > div > span").click()
- def box_Transfer_into_Kits(self):
- self.Transfer_into_kits = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(10) > div.GJCH5BMNV > table > tbody > tr > td.GJCH5BMBS > div > span").click()
- def box_Transfer_outof_kits(self):
- self.Transfer_outof_kits = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(11) > div.GJCH5BMNV > table > tbody > tr > td.GJCH5BMBS > div > span").click()
- def box_Empty_kits(self):
- self.Empty_Kits = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(12) > div.GJCH5BMNV > table > tbody > tr > td.GJCH5BMBS > div > span").click()
- def box_Avail_Altered(self):
- self.Avail_Altered = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div:nth-child(2) > div:nth-child(13) > div.GJCH5BMNV > table > tbody > tr > td.GJCH5BMBS > div > span").click()
- # Table Parsing v1 For indepth analysis
- def tableparsing(self): #Parses the table and reads each row
- y = 1
- while y < 100:
- try:
- self.tabelrowcurr = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr["+str(y)+"]")
- i = 2
- x = 0
- print('Reading row '+str(y)+' Part Number: '+str(self.variable))
- self.logging.debug('Parsing Table @ row '+str(y)+' Part Number: '+str(self.variable))
- while i < 6:
- if i == 5:
- self.cellcontainerlocation = None
- self.tablerowcontainer = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr["+str(y)+"]/td[5]/div/table/tbody/tr/td[1]")
- self.cellcontainer = self.tablerowcontainer.get_attribute('innerHTML')
- self.tablerowcontainerlocation = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr["+str(y)+"]/td[5]/div/table/tbody/tr/td[2]/span")
- self.cellcontainerlocation = self.tablerowcontainerlocation.get_attribute('innerHTML')
- if "PKG" in self.cellcontainer:
- self.cellcontainer = None
- self.tablerowcontainer = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr["+str(y)+"]/td[5]/div/table/tbody/tr/td[2]/span")
- self.cellcontainer = self.tablerowcontainer.get_attribute('innerHTML')
- print(self.cellcontainer)
- self.cellcontainer = None
- self.cellcontainerlocation = None
- continue
- else:
- print(self.cellcontainer +' '+ self.cellcontainerlocation)
- self.cellcontainer = None
- self.cellcontainerlocation = None
- i += 1
- continue
- if i == 6:
- self.tablesite = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr[1]/td[6]/div/table/tbody/tr/td[1]")
- self.cellsite = self.tablesite.get_attribute('innerHTML')
- self.tablelocation = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr[1]/td[6]/div/table/tbody/tr/td[2]/span")
- self.celllocation = self.tablelocation.get_attribute('innerHTML')
- print(self.cellsite +' '+ self.celllocation)
- self.cellsite = None
- self.celllocation = None
- i += 1
- continue
- while x < 1:
- self.tablerowspan = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr["+str(y)+"]/td[2]/span")
- self.cell2 = self.tablerowspan.get_attribute('innerHTML')
- print(self.cell2)
- self.cell2 = None
- x += 1
- i += 1
- self.tablerow = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr["+str(y)+"]/td["+str(i)+"]/div")
- self.cell = self.tablerow.get_attribute('innerHTML')
- print(self.cell)
- self.cell = None
- i += 1
- print('')
- except:
- try:
- self.clicknext = self.xpath("//td[@class=GJCH5BMNXD']/table/tbody/tr/td[3]").click()
- continue
- except:
- print('End of Records')
- print('Going to next product')
- break
- y += 1
- # Table Parsing v2 For faster processes
- def table_static_read(self): #Parses the table and reads each row
- y = 1
- while y < 101:
- time.sleep(0.5)
- self.tabelrowcurr = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr["+str(y)+"]")
- print('Reading row '+str(y)+' Part Number: '+str(self.variable))
- self.table_product_number = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr["+str(y)+"]/td[2]/span").get_attribute('innerHTML')
- print(self.table_product_number)
- self.table_description = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr["+str(y)+"]/td[3]/div").get_attribute('innerHTML')
- print(self.table_description)
- self.table_Lot_serial = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr["+str(y)+"]/td[4]/div").get_attribute('innerHTML')
- print(self.table_Lot_serial)
- self.table_container = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr["+str(y)+"]/td[5]/div/table/tbody/tr/td[2]/span").get_attribute('innerHTML')
- print(self.table_container)
- self.table_container_location = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr["+str(y)+"]/td[5]/div/table/tbody/tr/td[1]").get_attribute('innerHTML')
- print(self.table_container_location)
- self.table_site = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr["+str(y)+"]/td[6]/div/table/tbody/tr/td[1]").get_attribute('innerHTML')
- print(self.table_site)
- self.table_location = self.xpath("//table[@class='GJCH5BMKM']/tbody/tr["+str(y)+"]/td[6]/div/table/tbody/tr/td[2]/span").get_attribute('innerHTML')
- print(self.table_location)
- if str(int(self.lotnumber)) in str(self.table_Lot_serial):
- if 'CANCELED' in str(self.table_container):
- print('Case Canceled/Closed for: '+str(self.variable)+' Lot #: '+str(self.lotnumber)+'')
- # self.text = 'Case Canceled/Closed for: '+str(self.variable)+' Lot #: '+str(self.lotnumber)+'\n'
- # calls_sms.output_file(self)
- break
- if 'COMPLETE' in str(self.table_container):
- print('found match')
- self.table_container_element = self.xpath("//span[@class='GJCH5BMKU' and text()='"+str(self.table_container)+"']").click()
- time.sleep(2)
- try:
- loop = "body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(8) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > table > tbody > tr > td.GJCH5BMH0E > div:nth-child(1) > div.GJCH5BMI1E > table > tbody > tr > td > table > tbody > tr:nth-child(5) > td.GJCH5BMM1E > table > tbody > tr > td:nth-child(1) > span"
- self.wait_for_css_paybackline(loop)
- self.paybackline = self.css(loop)
- except NoSuchElementException:
- print(str(date.today())+' no payback orders for: '+str(self.variable)+' Lot #: '+str(self.lotnumber)+' Case #: '+str(self.casenumber)+'')
- self.text ='no payback orders for: '+str(self.variable)+' Lot #: '+str(self.lotnumber)+' Case #: '+str(self.casenumber)+'\n'
- calls_sms.output_file(self)
- time.sleep(0.5)
- self.driver.execute_script("window.history.go(-1)")
- break
- calls_sms.openpayback(self)
- time.sleep(1)
- break
- else:
- y += 1
- continue
- y += 1
- continue
- try:
- self.clicknext = self.xpath("//td[@class='GJCH5BMNXD']/table/tbody/tr/td[3]").click()
- y = 0
- continue
- except:
- print('End of Records / No Records Found')
- print('Going to next product')
- self.text = 'End of Records / No Records Found, Going to next product\n'
- calls_sms.output_file(self)
- break
- #order page
- def openpayback(self):
- x = 1
- i = 0
- j = 0
- qtyopen = 0
- totitems = 0
- loop = "body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(9) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > table > tbody > tr > td.GJCH5BMH0E > div:nth-child(1) > div.GJCH5BMO0E > table > tbody > tr > td.GJCH5BMN0E"
- self.wait_for_css(loop)
- while x < 10:
- self.paybackline = None
- try:
- self.paybackline = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(8) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > table > tbody > tr > td.GJCH5BMH0E > div:nth-child(1) > div.GJCH5BMI1E > table > tbody > tr > td > table > tbody > tr:nth-child(5) > td.GJCH5BMM1E > table > tbody > tr > td:nth-child("+str(x)+") > span")
- self.paybackstring = self.paybackline.get_attribute('innerHTML')
- if '(Approved)' in str(self.paybackstring):
- print(str(self.paybackstring)+' valid')
- self.driver.implicitly_wait(3)
- loop = "body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(8) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > table > tbody > tr > td.GJCH5BMH0E > div:nth-child(1) > div.GJCH5BMI1E > table > tbody > tr > td > table > tbody > tr:nth-child(5) > td.GJCH5BMM1E > table > tbody > tr > td:nth-child("+str(x)+") > span"
- self.wait_for_css(loop)
- self.paybackline = self.css(loop).click()
- k = 1
- time.sleep(3)
- while k < 21:
- try:
- self.ordertableprod = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(5) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div.GJCH5BMDUH > div > div.GJCH5BMOUD > div > div > div:nth-child(2) > div.GJCH5BMFM > div > table > tbody > tr:nth-child("+str(k)+") > td:nth-child(3) > span").get_attribute('innerHTML')
- print('Product # '+str(self.ordertableprod))
- self.order_qty_open = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(5) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div.GJCH5BMDUH > div > div.GJCH5BMOUD > div > div > div:nth-child(2) > div.GJCH5BMFM > div > table > tbody > tr:nth-child("+str(k)+") > td:nth-child(7) > div").get_attribute('innerHTML')
- print('order_qty_open ='+str(self.order_qty_open)+'')
- if str(self.variable) == str(self.ordertableprod):
- print('found item')
- if int(float(str(self.order_qty_open))) > 1: # if grater than 1 reduce by 1 and do not close
- print('order_qty_open = '+str(self.order_qty_open)+'')
- qtyopen += int(float(str(self.order_qty_open)))
- totitems += int(float(str(self.order_qty_open)))
- self.lineinto = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(5) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div.GJCH5BMDUH > div > div.GJCH5BMOUD > div > div > div:nth-child(2) > div.GJCH5BMFM > div > table > tbody > tr:nth-child("+str(k)+") > td:nth-child(2) > span").click()
- time.sleep(2)
- self.modify = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(2) > div > table > tbody > tr > td.GJCH5BMETF > table > tbody > tr > td.GJCH5BMDTF > span").click()
- calls_sms.mutation_modifyline(self)
- time.sleep(2)
- self.modify_cancel = self.css("body > div.gwt-PopupPanel > div > div > div > table > tbody > tr > td > div > div.GJCH5BML2C > div > table > tbody > tr:nth-child(2) > td > table > tbody > tr > td.GJCH5BMIED > span > div > div.GJCH5BMJYC.GJCH5BMGYC").click()
- """the below line of code physically modifies the line, do not uncomment unless in QA or program is 100% working"""
- # self.modify_save = self.css("body > div.gwt-PopupPanel > div > div > div > table > tbody > tr > td > div > div.GJCH5BML2C > div > table > tbody > tr:nth-child(2) > td > table > tbody > tr > td:nth-child(2) > span > div > div.GJCH5BMN-C.GJCH5BMK-C").click()
- # time.sleep(2)
- self.driver.execute_script("window.history.go(-1)")
- raise NoSuchElementException
- break
- elif int(float(str(self.order_qty_open))) == 1: # if equal to 1 / close line
- qtyopen += 1
- self.lineinto = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(5) > div > div:nth-child(2) > div > div:nth-child(3) > div > div > div > div.GJCH5BMDUH > div > div.GJCH5BMOUD > div > div > div:nth-child(2) > div.GJCH5BMFM > div > table > tbody > tr:nth-child("+str(k)+") > td:nth-child(2) > span").click()
- """the below line of code physically closes the line, do not uncomment unless in QA or program is 100% working"""
- # self.closeline = self.css("body > div:nth-child(8) > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(6) > div > div:nth-child(2) > div > div:nth-child(2) > div > table > tbody > tr > td.GJCH5BMETF > table > tbody > tr > td:nth-child(2) > span").click()
- time.sleep(2)
- self.driver.execute_script("window.history.go(-1)")
- raise NoSuchElementException
- break
- k = 21
- except NoSuchElementException:
- print('Total items on order = '+str(totitems)+', total qty open = '+str(qtyopen)+'')
- totitems = 0
- qtyopen = 0
- self.driver.execute_script("window.history.go(-1)")
- time.sleep(1)
- break
- totitems += 1
- k += 1
- j += 1
- x += 2
- continue
- elif '(Closed)' in str(self.paybackstring):
- print(str(self.paybackstring)+' not valid')
- i += 1
- x += 2
- continue
- except NoSuchElementException:
- print('no remaining payback order for: '+str(self.variable)+' Lot #: '+str(self.lotnumber)+' Case #: '+str(self.casenumber)+'')
- print('Found '+str(i+j)+' order(s), '+str(j)+' Approved, '+str(i)+' Closed')
- # self.text = 'no remaining payback order for: '+str(self.variable)+' Lot #: '+str(self.lotnumber)+' Case #: '+str(self.casenumber)+'\n'
- # calls_sms.output_file(self)
- # self.text = 'Found '+str(i+j)+' order(s), '+str(j)+' Approved, '+str(i)+' Closed\n'
- # calls_sms.output_file(self)
- self.driver.implicitly_wait(2)
- self.driver.execute_script("window.history.go(-1)")
- break
- def mutation_modifyline(self): # modifies the payback line item QTY open by 1
- qty = int(float(str(self.order_qty_open))) - 1
- self.actions = ActionChains(self.driver)
- self.modify_box = self.css("body > div.gwt-PopupPanel > div > div > div > table > tbody > tr > td > div > div.GJCH5BML2C > div > table > tbody > tr:nth-child(1) > td > table > tbody > tr:nth-child(1) > td.GJCH5BMCS > input")
- self.modify_box.click()
- self.modify_box_sendkey = self.actions.move_to_element(self.modify_box).send_keys(str(qty)).perform()
- print('Item '+str(self.variable)+' at QTY Open '+str(self.order_qty_open)+' reduced by `1` to new QTY of '+str(qty)+' and has been modified')
- self.actions = None #MUST BE CLEAR FOR THIS FUNCTION TO WORK!
- def mutation_err_nopaybck(self):
- self.mutation_nopaybckstring = 'no payback order for: '+str(self.variable)+' Lot #: '+str(self.lotnumber)+''
- def mutation_err_caseerr(self):
- self.mutation_caseerrstring = 'Case Canceled/Closed for: '+str(self.variable)+' Lot #: '+str(self.lotnumber)+''
- #Product Chooser
- def prod_choose_searchbar(self):
- #finds the searchbox and clicks
- self.actions = ActionChains(self.driver)
- try:
- loop = ".GJCH5BMASD"
- self.wait_for_css(loop)
- self.search = self.css(loop)
- self.search.click()
- self.clickinto = self.actions.move_to_element(self.search).send_keys(str(self.variable) + Keys.RETURN).perform()
- except NoSuchElementException:
- #os.system('python sms_err_select_inv.py')
- os.system('python sms_generic_err.py')
- self.logging.debug('Error Occured '+str(date.today())+' prod_choose_searchbar NoSuchElementException')
- try:
- calls_sms.stock_tab(self)
- calls_sms.prod_choose_searchbar(self)
- except:
- os.system('python sms_generic_err.py')
- pass
- self.actions = None #MUST BE CLEAR FOR THIS FUNCTION TO WORK!
- def prod_choose_clicksearch(self):
- try:
- loop = "//td[@class='GJCH5BMPR']/span/div[2]"
- self.wait_for_xpath(loop)
- self.clicksearch = self.xpath(loop).click()
- except:
- loop = "body > div.GJCH5BMMRD > div > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(2) > div > table > tbody > tr:nth-child(1) > td.GJCH5BMPR > span"
- self.wait_for_css(loop)
- self.css(loop).click()
- def prod_choose_clickadd(self):
- time.sleep(1)
- loop = "body > div.GJCH5BMMRD > div > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(4) > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(3) > div > div > table > tbody > tr > td.GJCH5BMHM.GJCH5BMEO.GJCH5BMAP.GJCH5BMMM > div > table > tbody > tr > td > table > tbody > tr > td.GJCH5BMCHI > span"
- self.wait_for_css(loop)
- self.clickadd = self.css(loop).click()
- def prod_choose_clickfinish(self):
- loop = "//div[@class='GJCH5BMJYC GJCH5BMGYC' and text()='Finish']"
- self.wait_for_xpath(loop)
- self.clickfinish = self.xpath(loop).click()
- def user_ask_invtab():
- os.system('python sms_err_select_inv.py')
- def user_ask_ciinsight():
- os.system('python sms_err_select_ciinsight.py')
- def check_site(self):
- self.inventory_connection = self.css("html body div div div.GJCH5BMPV div div div div div.GJCH5BMFX div.GJCH5BMHX table.GJCH5BMGX tbody tr td.GJCH5BMCX table tbody tr td.GJCH5BMOW span.GJCH5BMKU").get_attribute('innerHTML')
- ctypes.windll.user32.MessageBoxW(0, 'You are connected to '+str(self.inventory_connection)+'', 'Notice!', 1)
- def mutation(self):
- os.system("cls")
- i = 0
- print('Mutating stock')
- while i < 30:
- try:
- calls_sms.stock_tab_prd_select(self)
- except:
- try:
- calls_sms.stock_tab(self)
- calls_sms.stock_tab_prd_select(self)
- except:
- self.driver.execute_script("window.history.go(-1)")
- calls_sms.stock_tab(self)
- calls_sms.stock_tab_prd_select(self)
- calls_sms.prod_choose_searchbar(self)
- time.sleep(1)
- calls_sms.prod_choose_clickadd(self)
- calls_sms.prod_choose_clickfinish(self)
- calls_sms.stock_searchbtn(self)
- print('Parsing Table for data')
- calls_sms.table_static_read(self)
- calls_sms.nextp(self)
- if str(self.variable) == 'end':
- print('Finished Parsing')
- self.logging.debug('Finished Parsing')
- elif i == 30:
- print('Finished Parsing')
- self.logging.debug('Finished Parsing')
- else:
- continue
- i += 1
- #########################################################################
- #########################################################################
- class assignments():
- def __init__(self):
- self.SMS = calls_sms()
- self.SYS = os.system
- self.sleep = time.sleep
- self.st = 0
- logging.basicConfig(filename='server-sms_automation.err.log',level=logging.DEBUG)
- self.logging = logging
- def login_to_sms(self): #will have username and password GUI
- #basic login structure
- self.SMS.launch()
- self.SMS.driver.implicitly_wait(3)
- self.SMS.var()
- self.SMS.login()
- time.sleep(3)
- #self.SMS.check_site()
- self.SYS('python sms_err_select_inv.py')
- self.sleep(self.st)
- #########################################################################
- #########################################################################
- """
- Test interactions down here!
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement