class GooglePage(WebGeneric): def __init__(self, driver): WebGeneric.__init__(self, driver) self.un_xpath = "//input[@name='q']" self.wg = WebGeneric(self.driver) def fb_login(self, un, pwd): self.wg.enter("xpath", self.un_xpath, un) self.wg.enter("xpath", self.pwd_xpath, pwd) self.wg.submit("xpath", self.login_xpath) def fb_close(self): self.wg.submit("xpath", self.close_xpath)
class FBLoginPage(WebGeneric): def __init__(self, driver): WebGeneric.__init__(self, driver) self.un_xpath = "//input[@class='_2zrpKA _1dBPDZ']" self.pwd_xpath = "//input[@type='password']" self.login_xpath = "//*[@class='_2AkmmA _1LctnI _7UHT_c']" self.close_xpath = "//*[@class='_2AkmmA _29YdH8']" self.wg = WebGeneric(self.driver) def fb_login(self, un, pwd): self.wg.enter("xpath", self.un_xpath, un) self.wg.enter("xpath", self.pwd_xpath, pwd) self.wg.submit("xpath", self.login_xpath) def fb_close(self): self.wg.submit("xpath", self.close_xpath)
class JenkinsLoginPage(WebGeneric): def __init__(self, driver): WebGeneric.__init__(self, driver) # self.driver=driver self.un_id = "j_username" self.pwd_name = "j_password" self.login_btn_xpath = "Submit" self.wg = WebGeneric(self.driver) def jenkins_login(self): un = self.wg.get_val("Login", "UserName") self.wg.enter("id", self.un_id, un) self.wg.enter("name", self.pwd_name, self.wg.get_val("Login", "Password")) self.wg.submit("xpath", self.login_btn_xpath) self.wg.get_screenshot()
class WindowHandlingPage(WebGeneric): def __init__(self,driver): WebGeneric.__init__(self,driver) self.login_xpath="//span[text()='Login']" self.email_tx_id="inputEmail" # 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 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")
def login_cms(self,UN,PWD): # Need to change driver-->self.driver #### 8 #### # self.driver.find_element_by_id("user_login").send_keys(UN) # self.driver.find_element_by_id("user_pass").send_keys(PWD) # self.driver.find_element_by_id("wp-submit").click() w=WebGeneric(self.driver) #### 14 #### w.enter("id",self.un_id,UN) w.enter("id",self.pwd_id,PWD) w.submit("id",self.sb_id) # "id" #### 16 #### # Control ->Webgeneric.py ##### 9 #### # Control-->LocatorGeneric.py #### 15 ####
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): # 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,USERNAME) self.wg.enter("id", self.un_id, un) #self.driver.find_element_by_name("pwd").send_keys("manager") self.wg.enter("name", self.pwd_name, self.wg.get_val("Login", "Password")) #self.wg.enter("name",self.pwd_name,PASSWORD) #self.driver.find_element_by_xpath("//*[text()='Login ']").click() self.wg.submit("xpath", self.login_btn_xpath) self.wg.get_screenshot()
def jenkinslogin(self, un, pwd): wg = WebGeneric(self.driver) wg.enter(self.un_id, un) wg.enter(self.pwd_name, pwd) wg.submit(self.login)
def zoomin_login(self, un, pwd): wg = WebGeneric(self.driver) wg.signin(self.signin_nav) wg.enter(self.un_id, un) wg.enter(self.pwd_id, pwd) wg.submit(self.Sign_in)