Advertisement
Guest User

Untitled

a guest
Oct 11th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. class JoinPage(unittest.TestCase):
  2.  
  3. @classmethod
  4. def setUpClass(cls):
  5.  
  6. chrome_options = webdriver.ChromeOptions()
  7. chrome_options.add_argument('--incognito')
  8. chrome_options.add_argument('--start-maximized')
  9. cls.browser = webdriver.Chrome('/home/andrew/Downloads/chromedriver', chrome_options=chrome_options)
  10.  
  11. def test_01_new_account_jp(self):
  12. with open('/home/andrew/PycharmProjects/test/jpage/accounts.csv', 'rb', ) as csvfile:
  13. the_file = csv.reader(csvfile, delimiter=',')
  14. for row in the_file:
  15. for i in range(2):
  16. self.browser.get('http://localhost:5000')
  17. user = row[0]
  18. password = row[1]
  19. self.browser.xpath('html/body/div[1]/div/div/div[2]/form/div[2]/div/button').click()
  20. self.browser.xpath(".//*[@id='Email']").send_keys(user)
  21. self.browser.xpath(".//*[@id='next']").click()
  22. self.browser.xpath(".//*[@id='Passwd']").send_keys(password)
  23.  
  24. class JoinPage(unittest.TestCase):
  25.  
  26.  
  27. def test_01_new_account_jp(self):
  28. with open('/home/andrey/PycharmProjects/test/jpage/accounts.csv', 'rb', ) as csvfile:
  29. the_file = csv.reader(csvfile, delimiter=',')
  30. for row in the_file:
  31. chrome_options = webdriver.ChromeOptions()
  32. chrome_options.add_argument('--incognito')
  33. chrome_options.add_argument('--start-maximized')
  34. browser = webdriver.Chrome('/home/andrey/Downloads/chromedriver',chrome_options=chrome_options)
  35. actions = ActionChains(browser)
  36. wait = WebDriverWait(browser, 20)
  37. browser.implicitly_wait(30)
  38. browser.get('http://localhost:5000')
  39. user = row[0]
  40. password = row[1]
  41. browser.xpath('html/body/div[1]/div/div/div[2]/form/div[2]/div/button').click()
  42. browser.xpath(".//*[@id='Email']").send_keys(user)
  43. browser.xpath(".//*[@id='next']").click()
  44. browser.xpath(".//*[@id='Passwd']").send_keys(password)
  45.  
  46. DesiredCapabilities capabilities = DesiredCapabilities.chrome();
  47. ChromeOptions options = new ChromeOptions();
  48. options.addArguments("incognito");
  49. capabilities.setCapability(ChromeOptions.CAPABILITY, options);
  50.  
  51. FirefoxProfile firefoxProfile = new FirefoxProfile();
  52. firefoxProfile.setPreference("browser.privatebrowsing.autostart", true);
  53.  
  54. DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
  55. capabilities.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true);
  56. capabilities.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private");
  57.  
  58. DesiredCapabilities capabilities = DesiredCapabilities.operaBlink();
  59. OperaOptions options = new OperaOptions();
  60. options.addArguments("private");
  61. capabilities.setCapability(OperaOptions.CAPABILITY, options);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement