Beispiel #1
0
 def openBrowser(self):
     driver.get(url)
     driver.maximize_window()
     time.sleep(1)
     driver.implicitly_wait(10)
     driver.delete_all_cookies()
     time.sleep(1)
    def test_apllycoupons(self):
        self.hp.selectdestination("Chennai", "India")
        self.hp.selectdate()
        pw = driver.current_window_handle

        self.fp.get_booknow_button().click()
        self.fp.get_continue_button().click()
        time.sleep(3)

        self.wbutil.handle_window_usingsessionid(pw)
        time.sleep(3)
        driver.implicitly_wait(10)
        print("initial price: ", self.rbp.get_initialprice())
        path = r"C:\Users\indud\PycharmProjects\mmt\report\data.xlsx"
        self.futils.writeXLdata(path, "Sheet4", 1, 1, "without coupon")
        self.futils.writeXLdata(path, "Sheet4", 2, 1,
                                self.rbp.get_initialprice())

        self.wbutil.scrolldown()
        self.rbp.select_coupon()
        time.sleep(1)
        print("after price: ", self.rbp.get_afterprice())
        self.futils.writeXLdata(path, "Sheet4", 1, 2, "with coupon")
        self.futils.writeXLdata(path, "Sheet4", 2, 2,
                                self.rbp.get_afterprice())
Beispiel #3
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()
Beispiel #4
0
    def logintommt(self):
        driver.implicitly_wait(10)
        self.__get_c().click()
        time.sleep(1)
        self.__get_createacc().click()

        futils = FileUtils()
        path = r"C:\Users\indud\PycharmProjects\mmt\test_data\testdata.json"
        credentials = futils.readJson(path)
        un = credentials["username"]
        pw = credentials["password"]

        self.__get_username().send_keys(un)
        #self.__get_username().send_keys("*****@*****.**")
        self.__get_continue().click()
        self.__get_password().send_keys(pw)
        #self.__get_password().send_keys("indudhara123!")
        self.__get_login().click()
        time.sleep(1)
 def get_username(self):
     print("in username")
     driver.implicitly_wait(10)
     driver.find_element_by_xpath(self.un).send_keys("admin")
Beispiel #6
0
 def get_all_elements_details(self,listofwebelements):
     time.sleep(6)
     driver.implicitly_wait(10)
     allelements = driver.find_elements_by_xpath(listofwebelements)
     for element in allelements:
         print(element.text)
Beispiel #7
0
 def allow_access(self):
     print("entered the allow_access fxn")
     driver.implicitly_wait(20)
     driver.find_element_by_id(self.allow1).click()
     driver.find_element_by_id(self.allow).click()
     driver.find_element_by_id(self.nxtbtn).click()
Beispiel #8
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
Beispiel #9
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()