Experiment 4 / Task No.04
Experiment 4 / Task No.04
Experiment 4 / Task No.04
A.1 Aim: Practical Usage of automated testing tools and Execution using QTP( example
Web site)
1.GUI Testing
2.Functional Testing
3.HTML Testing
4.System testing
LogIn Module:
# Generated by Selenium IDE
import pytest
import time
import json
class TestBakeryProjectTestingSQATLogIn():
self.driver = webdriver.Chrome()
self.vars = {}
self.driver.quit()
time.sleep(round(timeout / 1000))
wh_now = self.driver.window_handles
wh_then = self.vars["window_handles"]
return set(wh_now).difference(set(wh_then)).pop()
def test_bakeryProjectTestingSQATLogIn(self):
self.driver.get("http://localhost/project/index.html")
self.driver.set_window_size(1296, 696)
self.vars["window_handles"] = self.driver.window_handles
self.driver.find_element(By.LINK_TEXT, "Menu").click()
self.vars["win1411"] = self.wait_for_window(2000)
self.driver.switch_to.window(self.vars["win1411"])
self.driver.find_element(By.ID, "emob").click()
self.driver.find_element(By.ID, "emob").send_keys("sharma.rahul075@nmims.edu.in")
self.driver.find_element(By.ID, "pass").click()
self.driver.find_element(By.ID, "pass").send_keys("1234567890")
self.vars["window_handles"] = self.driver.window_handles
self.driver.find_element(By.ID, "submit").click()
self.vars["win7549"] = self.wait_for_window(2000)
self.driver.switch_to.window(self.vars["win7549"])
SignUp Module:
# Generated by Selenium IDE
import pytest
import time
import json
class TestBakeryProjectTestingSQAT():
self.driver = webdriver.Chrome()
self.vars = {}
self.driver.quit()
time.sleep(round(timeout / 1000))
wh_now = self.driver.window_handles
wh_then = self.vars["window_handles"]
return set(wh_now).difference(set(wh_then)).pop()
def test_bakeryProjectTestingSQAT(self):
self.driver.get("http://localhost/project/index.html")
self.driver.set_window_size(1296, 696)
self.vars["window_handles"] = self.driver.window_handles
self.driver.find_element(By.LINK_TEXT, "Menu").click()
self.vars["win115"] = self.wait_for_window(2000)
self.driver.switch_to.window(self.vars["win115"])
self.driver.find_element(By.ID, "fname").click()
self.driver.find_element(By.ID, "fname").send_keys("Rahul")
self.driver.find_element(By.ID, "lname").send_keys("Sharma")
self.driver.find_element(By.ID, "email").send_keys("rahsharma83@gmail.com")
self.driver.find_element(By.ID, "lname").click()
self.driver.find_element(By.NAME, "acc").click()
self.driver.find_element(By.ID, "num").click()
self.driver.find_element(By.ID, "num").send_keys("9654786320")
actions = ActionChains(self.driver)
actions.move_to_element(element).click_and_hold().perform()
actions = ActionChains(self.driver)
actions.move_to_element(element).perform()
actions.move_to_element(element).release().perform()
self.driver.find_element(By.NAME, "acc").click()
self.driver.find_element(By.ID, "email").send_keys("sharma.rahul075@nmims.edu.in")
self.driver.find_element(By.ID, "pass").click()
self.driver.find_element(By.ID, "pass").send_keys("0987654321")
self.driver.find_element(By.ID, "repass").click()
self.driver.find_element(By.ID, "repass").send_keys("0987654321")
self.driver.find_element(By.ID, "submit").click()