コード例 #1
0
 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()
コード例 #2
0
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()
コード例 #3
0
 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
コード例 #4
0
 def get_loginBtn(self):
     print("in login")
     driver.find_element_by_xpath(self.login).click()
コード例 #5
0
 def get_password(self):
     print("in pwd")
     driver.find_element_by_xpath(self.pwd).send_keys("manager")
コード例 #6
0
 def get_username(self):
     print("in username")
     driver.implicitly_wait(10)
     driver.find_element_by_xpath(self.un).send_keys("admin")
コード例 #7
0
 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
コード例 #8
0
 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()