Exemple #1
0
    def test_formSubmission(self, getData):
        log = self.getLogger()
        homePage = HomePage(self.driver)
        #homePage.getName().send_keys(getData[0])
        log.info("first name is " + getData["firstname"])
        homePage.getName().send_keys(getData["firstname"])
        #driver.find_element_by_css_selector("input[name='name']").send_keys("Suchithra")
        #driver.find_element_by_name("email").send_keys("*****@*****.**")
        homePage.getEmail().send_keys(getData["email"])
        homePage.getPwdCheck().click()
        #driver.find_element_by_id("exampleCheck1").click()

        self.selectOptionByText(homePage.getGender(), getData["gender"])

        homePage.getSubmit().click()
        #driver.find_element_by_xpath("//input[@type='submit']").click()

        # txt = driver.find_element_by_css_selector("[class*='alert-success']").text

        # txt = driver.find_element_by_class_name("alert-success").text
        #txt = driver.find_element_by_xpath("//*[contains(@class,'alert-success')]").text
        txt = homePage.getSuccess().text

        print(txt)

        assert "Success!" in txt
        self.driver.refresh()
    def test_formSubmission(self, getData):

        homePage = HomePage(self.driver)
        log.info("Full Name : " + getData["fullname"])
        homePage.getName().send_keys(getData["fullname"])
        homePage.getEmail().send_keys(getData["email"])
        homePage.getExampleCheck().click()
        self.selectOptionsByText(homePage.getGender(), getData["gender"])
        homePage.submitForm().click()

        alertText = homePage.getSuccess().text

        assert ("Success" in alertText)
        self.driver.refresh()