def in_homePage(self): print("in home page") a_obj = ActionChains(driver) driver.find_element_by_xpath(self.Tasks).click() element_report = driver.find_element_by_xpath(self.reports) a_obj.context_click(element_report).perform() element = driver.find_element_by_xpath(self.ele) a_obj.click(element).perform() a_obj.key_down(Keys.CONTROL).send_keys("a").key_up(Keys.CONTROL).perform()
def test_login(): driver.get(url1) driver.implicitly_wait(6) driver.maximize_window() pop_up = driver.find_element_by_xpath( '//div[@class="Og_iib col col-2-5 _3SWFXF"]').is_displayed() if pop_up == True: driver.find_element_by_xpath( '//input[@class="_2zrpKA _1dBPDZ"]').send_keys(9591593927) driver.find_element_by_xpath('//input[@type="password"]').send_keys( 9880424831) driver.find_element_by_xpath( '//button[@class="_2AkmmA _1LctnI _7UHT_c"]').click() else: driver.find_element_by_xpath('//div[@class="_2aUbKa"]').click()
def search_products(self): page_title = driver.title print("page title is : ", page_title) print(driver.current_window_handle) print("in search") driver.find_element_by_xpath(self.crossBtn).click() driver.find_element_by_xpath(self.search).send_keys("Mobiles") driver.find_element_by_xpath(self.search_icon).click() return page_title
def get_loginBtn(self): print("in login") driver.find_element_by_xpath(self.login).click()
def get_password(self): print("in pwd") driver.find_element_by_xpath(self.pwd).send_keys("manager")
def get_username(self): print("in username") driver.implicitly_wait(10) driver.find_element_by_xpath(self.un).send_keys("admin")
def after_winHandling(self): driver.implicitly_wait(10) driver.find_element_by_xpath(self.cart).click() pagetitle2 = driver.title print("page title 2 is : ", pagetitle2) return pagetitle2
def after_search(self): print("in after search") driver.implicitly_wait(10) driver.find_element_by_xpath(self.check_box).click() time.sleep(3) driver.find_element_by_xpath(self.mob_xpath).click()