def __init__(self, driver): WebGeneric.__init__(self, driver) self.driver = driver self.un_id = "username" self.pwd_name = "pwd" self.login_btn_xpath = "//*[text()='Login ']" self.wg = WebGeneric(self.driver)
def __init__(self, driver): WebGeneric.__init__(self, driver) #self.driver=driver self.id = "menu" self.addNw_btn_xpath = "//img[@class='tb-image']" # self.newcustmr_btn_xpath="//div[text()='+ New Customer']" # self.cancel_btn_xpath = '//*[@id="customerLightBoxCloseButton"]' self.wg = WebGeneric(self.driver)
class HomeTime: def __init__(self, driver): WebGeneric.__init__(self, driver) self.wg = WebGeneric(self.driver) def homescreen(self): self.wg.submit("xpath", "//a[text()='View Time-Track']") self.wg.submit("xpath", "//a[text()='Lock Time-Track']")
def __init__(self, driver): WebGeneric.__init__(self, driver) #self.driver=driver self.un_id = "mat-input-0" #aself.pwd_name= self.login_btn_xpath = "//*[@id='sign-in-button']/span" self.otp_btn = '//*[@placeholder="Enter OTP here"]' self.submit_btn = '//span[text()="Verify"]' self.wg = WebGeneric(self.driver)
class HomeScreen(WebGeneric): def __init__(self, driver): WebGeneric.__init__(self, driver) self.driver = driver self.logout_btn = '//*[@id="logoutLink"]' self.wg = WebGeneric(self.driver) def logout(self): self.wg.submit("xpath", self.logout_btn) print("logout Passed")
def __init__(self, driver): WebGeneric.__init__(self, driver) #self.driver=driver self.reports_btn_id = "/html/body/app-root/div/app-dashboard-container/div/mat-drawer-container/mat-drawer-content/mat-sidenav-container/mat-sidenav-content/mat-toolbar/mat-toolbar-row[1]/div[2]/a[3]/span" self.admin_dash_xpath = '//*[@id="cdk-overlay-5"]/div/div/span/a[2]' self.menu = '//mat-icon[@id="menu"]' self.ord_plc_btn = '//span[contains(text(),"Order Placing")]' self.retrv_btn = '//*[contains(text(),"Order Retrieve")]' #self.retv_check='//*[@id="mat-checkbox-87"]/label/div' self.re_n_mail = "//*[contains(text(),'Retrieve & Email')]" self.wg = WebGeneric(self.driver)
def __init__(self, driver): WebGeneric.__init__(self, driver) #self.driver=driver self.serch_className = "/html/body/app-root/div/app-dashboard-container/div/mat-drawer-container/mat-drawer-content/mat-sidenav-container/mat-sidenav-content/mat-toolbar/mat-toolbar-row[1]/app-search-bar/form/div/input" self.add_btn_xpath = '//*[@class="mat-button-wrapper"]' self.qty = '//*[@id="dashboard-container"]/div/div[3]/app-common-search-container/div/div[1]/table/tr/td[6]/div[1]/div/div[1]/div/input' self.cnfm = "//*[@class='mat-button-wrapper']" self.cart = "/html/body/app-root/div/app-dashboard-container/div/mat-drawer-container/mat-drawer-content/mat-sidenav-container/mat-sidenav-content/mat-toolbar/mat-toolbar-row[1]/div[2]/a[2]/span" self.slt = "mat-radio-2" #//input[contains(@value, "SLOT_TWO")] self.plc_ord = '//*[@id="dashboard-content"]/mat-drawer-container/mat-drawer/div/div[2]/div[7]/button/span' self.wg = WebGeneric(self.driver)
class DashbrdPage(WebGeneric): def __init__(self, driver): WebGeneric.__init__(self, driver) #self.driver=driver self.id = "menu" self.addNw_btn_xpath = "//img[@class='tb-image']" # self.newcustmr_btn_xpath="//div[text()='+ New Customer']" # self.cancel_btn_xpath = '//*[@id="customerLightBoxCloseButton"]' self.wg = WebGeneric(self.driver) def task_login(self): # Logint to application - section 2 >>S2 #self.driver.find_element_by_id("username").send_keys("admin") #un= self.wg.get_val("Login","UserName") #self.driver.find_element_by_name("pwd").send_keys("manager") self.wg.submit("id", self.id) self.wg.submit("xpath", self.addNw_btn_xpath)
class WindowHandlingPage(WebGeneric): def __init__(self, driver): WebGeneric.__init__(self, driver) self.login_xpath = "/html/body/div[1]/div[1]/div[5]/ul/li[2]/a" self.email_tx_id = "identifierId" # self.dest_xpath="//*[@id='droppable']" self.wg = WebGeneric(self.driver) def window_handle(self): cur_win_id = self.driver.current_window_handle time.sleep(15) #self.locator("xpath",self.login_xpath) self.wg.submit("xpath", self.login_xpath) mul_win_id = self.driver.window_handles print(mul_win_id) for id in mul_win_id: if (cur_win_id != id): self.driver.switch_to.window(id) time.sleep(3) self.wg.enter("id", self.email_tx_id, "Test")
class LoginPage(WebGeneric): def __init__(self, driver): WebGeneric.__init__(self, driver) self.driver = driver self.un_id = "username" self.pwd_name = "pwd" self.login_btn_xpath = "//*[text()='Login ']" self.wg = WebGeneric(self.driver) def acti_login(self): #self.driver.find_element_by_id('username').send_keys('admin') # self.wg.enter("id",self.un_id, USERNAME) un = self.wg.read_data("E:/data.xlsx", "Sheet1", "username") self.wg.enter("id", self.un_id, un) #self.driver.find_element_by_name("pwd").send_keys("manager") pwd = self.wg.read_data("E:/data.xlsx", "Sheet1", "pass") self.wg.enter("name", self.pwd_name, pwd) self.wg.submit("xpath", self.login_btn_xpath)
class LoginPage(WebGeneric): def __init__(self, driver): WebGeneric.__init__(self, driver) #self.driver=driver self.un_id = "mat-input-0" #aself.pwd_name= self.login_btn_xpath = "//*[@id='sign-in-button']/span" self.otp_btn = '//*[@placeholder="Enter OTP here"]' self.submit_btn = '//span[text()="Verify"]' self.wg = WebGeneric(self.driver) def acti_login(self): # Logint to application - section 2 >>S2 #self.driver.find_element_by_id("username").send_keys("admin") #un= self.wg.get_val("Login","UserName") self.wg.enter("id", self.un_id, "7701930106") #self.wg.enter("name",self.pwd_name,"manager") #self.driver.find_element_by_name("pwd").send_keys("manager") self.wg.submit("xpath", self.login_btn_xpath) self.wg.enter("xpath", self.otp_btn, '987654') self.wg.submit("xpath", self.submit_btn)
class TaskScreen(WebGeneric): def __init__(self, driver): WebGeneric.__init__(self, driver) self.driver = driver self.user_name = '//input[@class="inputFieldWithPlaceholder"]' self.user_descrip = "//textarea[@placeholder='Enter Customer Description']" self.wg = WebGeneric(self.driver) def task(self): self.wg.submit("xpath", '//*[@id="topnav"]/tbody/tr[1]/td[3]/a/div[1]') self.wg.submit("xpath", '//div[text()="Add New"]') self.wg.submit("xpath", "//div[text()='+ New Customer']") self.wg.text("xpath", self.user_name, 'Akshay121') self.wg.text("xpath", self.user_descrip, 'good one11') self.wg.submit("xpath", "//div[@class='emptySelection']") import time time.sleep(5) self.wg.submit( "xpath", '//*[@id="customerLightBox_content"]/div[3]/div[2]/div[2]') self.wg.alert()
def __init__(self, driver): WebGeneric.__init__(self, driver) self.wg = WebGeneric(self.driver)
def __init__(self, driver): WebGeneric.__init__(self, driver) self.login_xpath = "/html/body/div[1]/div[1]/div[5]/ul/li[2]/a" self.email_tx_id = "identifierId" # self.dest_xpath="//*[@id='droppable']" self.wg = WebGeneric(self.driver)
def __init__(self, driver): WebGeneric.__init__(self, driver) self.driver = driver self.logout_btn = '//*[@id="logoutLink"]' self.wg = WebGeneric(self.driver)
def __init__(self, driver): WebGeneric.__init__(self, driver) self.driver = driver self.user_name = '//input[@class="inputFieldWithPlaceholder"]' self.user_descrip = "//textarea[@placeholder='Enter Customer Description']" self.wg = WebGeneric(self.driver)
class HomePage(WebGeneric): def __init__(self, driver): WebGeneric.__init__(self, driver) #self.driver=driver self.serch_className = "/html/body/app-root/div/app-dashboard-container/div/mat-drawer-container/mat-drawer-content/mat-sidenav-container/mat-sidenav-content/mat-toolbar/mat-toolbar-row[1]/app-search-bar/form/div/input" self.add_btn_xpath = '//*[@class="mat-button-wrapper"]' self.qty = '//*[@id="dashboard-container"]/div/div[3]/app-common-search-container/div/div[1]/table/tr/td[6]/div[1]/div/div[1]/div/input' self.cnfm = "//*[@class='mat-button-wrapper']" self.cart = "/html/body/app-root/div/app-dashboard-container/div/mat-drawer-container/mat-drawer-content/mat-sidenav-container/mat-sidenav-content/mat-toolbar/mat-toolbar-row[1]/div[2]/a[2]/span" self.slt = "mat-radio-2" #//input[contains(@value, "SLOT_TWO")] self.plc_ord = '//*[@id="dashboard-content"]/mat-drawer-container/mat-drawer/div/div[2]/div[7]/button/span' self.wg = WebGeneric(self.driver) def Home_login(self): self.wg.enter("xpath", self.serch_className, "Sinarest Drops(p)") time.sleep(5) self.wg.submit("xpath", self.add_btn_xpath) self.wg.submit1("xpath", self.qty, '17') self.wg.submit("xpath", self.cnfm) time.sleep(5) self.wg.submit("xpath", self.cart) time.sleep(5) self.wg.submit('id', self.slt) time.sleep(3) self.wg.submit('xpath', self.plc_ord) time.sleep(4)