Exemple #1
0
    def test_formSubmission(self, getData):
        # driver = webdriver.Chrome(executable_path='C:\\chromedriver.exe')
        # driver.get('https://rahulshettyacademy.com/angularpractice/')

        log = self.getLogger()
        homepage = HomePage(self.driver)

        # driver.find_element_by_name('name').send_keys('Rahul')
        # driver.find_element_by_id('exampleCheck1').click()
        # driver.find_element_by_css_selector('Input[name = "name"]').send_keys('Rahul')
        # driver.find_element_by_name('email').send_keys('Shetty')
        # driver.find_element_by_xpath('//input[@type="submit"]').click()

        log.info('first name is ' + getData['firstname'])
        homepage.getName().send_keys(getData['firstname'])
        homepage.getEmail().send_keys(getData['lastname'])
        homepage.getCheckBox().click()
        # sel = Select(homepage.getGender())
        # sel.select_by_visible_text('Male')
        self.selectOptionByText(homepage.getGender(), getData['gender'])

        homepage.submitButton().click()
        alertText = homepage.getSuccessMSG().text
        assert ('success' in alertText)
        self.driver.refresh()
Exemple #2
0
    def test_formSubmission(self, getData):
        log = self.getLogger()
        homePage = HomePage(self.driver)
        log.info("first name is " + getData["firstname"])
        homePage.getName().send_keys(getData["firstname"])
        homePage.getEmail().send_keys(getData["email"])
        homePage.zgetCheckbox().click()
        self.selectOptionByText(homePage.getGender(), getData["gender"])
        homePage.submitForm().click()

        alertText = homePage.getSuccessMessage().text

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