file:///C/Users/shubh/Desktop/New Text Document (2) .TXT (2/10/2025 11:22:02 PM)
file:///C/Users/shubh/Desktop/New Text Document (2) .TXT (2/10/2025 11:22:02 PM)
month = context.driver.find_element("xpath",
"//body/div[6]/div[3]/div[1]/div[1]/div[1]/div[2]/form[1]/div[1]/div[2]/div[4]/div[1]/select[2]")
select = Select(month)
select.select_by_visible_text('August')
year = context.driver.find_element("xpath",
"//body/div[6]/div[3]/div[1]/div[1]/div[1]/div[2]/form[1]/div[1]/div[2]/div[4]/div[1]/select[3]")
select = Select(year)
select.select_by_visible_text('1999')
context.driver.find_element("xpath", "//input[@id='Email']").send_keys('[email protected]')
context.driver.find_element("xpath", "//input[@id='Company']").send_keys('sgb')
context.driver.find_element("xpath", "//input[@id='Password']").send_keys('123456')
context.driver.find_element("xpath", "//input[@id='ConfirmPassword']").send_keys('123456')
@then(u'click register')
def register(context):
context.driver.find_element("xpath", "//button[@id='register-button']").click()
time.sleep(2)
context.driver.find_element("xpath", "//a[contains(text(),'Continue')]").click()
#-------------------------------------------------------------------------------- login-------------------
@then(u'click login')
def loginbttn(context):
context.driver.find_element("xpath","//button[contains(text(),'Log in')]").click()
time.sleep(3)
#---------------------------------------------------------------------------------------------------------
@then(u'click product')
def clkpd(context):
context.driver.find_element("xpath",
"//body/div[6]/div[3]/div[1]/div[1]/div[1]/div[1]/div[4]/div[2]/div[2]/div[1]/div[1]/a[1]/img[1]").click()
@then(u'add product')
def addpro(context):
context.driver.find_element("xpath", "//button[@id='add-to-cart-button-4']").click()
@then(u'click agree')
def step_impl(context):
context.driver.find_element("xpath", "//input[@id='termsofservice']").click()
@then(u'click checkout')
def check(context):
context.driver.find_element("xpath", "//button[@id='checkout']").click()
@then(u'click continue')
def cont(context):
context.driver.implicitly_wait(10)
context.driver.find_element("xpath",
"//body/div[6]/div[3]/div[1]/div[1]/div[1]/div[2]/ol[1]/li[3]/div[2]/form[1]/div[2]/button[1]").click()
context.driver.find_element("xpath",
"//body/div[6]/div[3]/div[1]/div[1]/div[1]/div[2]/ol[1]/li[4]/div[2]/div[1]/button[1]").click()
context.driver.find_element("xpath",
"//body/div[6]/div[3]/div[1]/div[1]/div[1]/div[2]/ol[1]/li[5]/div[2]/div[1]/button[1]").click()
context.driver.find_element("xpath", "//button[contains(text(),'Confirm')]").click()