Advertisement
Guest User

Untitled

a guest
Aug 10th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. import unittest
  2.  
  3. from selenium import webdriver
  4. from selenium.webdriver.support.ui import Select
  5.  
  6.  
  7. # create a new Firefox session
  8. driver = webdriver.Firefox()
  9. driver.implicitly_wait(30)
  10. driver.maximize_window()
  11.  
  12. # navigate to the application home page
  13. driver.get("http://www.amazon.com/")
  14.  
  15.  
  16. if 'Sign Out' in driver.page_source:
  17. pass
  18. else:
  19. mouse_over("//*[@id='nav-link-yourAccount]")
  20. hover = driver.find_element_by_xpath("//*[@id='nav-link-yourAccount]")
  21. hover.click()
  22. logi = driver.find_element_by_xpath("//*[@id='nav-flyout-ya-signin']")
  23. logi.click()
  24. # username = driver.find_element_by_id("login_login_username")
  25. # username.send_keys("student2")
  26. # password= driver.find_element_by_id("login_login_password")
  27. # password.send_keys("Testing1")
  28. # loginbutton=driver.find_element_by_id("login_submit")
  29. # loginbutton.click()
  30.  
  31. mouse_over("//*[@id='nav-link-yourAccount]")
  32.  
  33. hover = driver.find_element_by_xpath("//*[@id='nav-link-yourAccount']")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement