Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class JoinPage(unittest.TestCase):
- @classmethod
- def setUpClass(cls):
- chrome_options = webdriver.ChromeOptions()
- chrome_options.add_argument('--incognito')
- chrome_options.add_argument('--start-maximized')
- cls.browser = webdriver.Chrome('/home/andrew/Downloads/chromedriver', chrome_options=chrome_options)
- def test_01_new_account_jp(self):
- with open('/home/andrew/PycharmProjects/test/jpage/accounts.csv', 'rb', ) as csvfile:
- the_file = csv.reader(csvfile, delimiter=',')
- for row in the_file:
- for i in range(2):
- self.browser.get('http://localhost:5000')
- user = row[0]
- password = row[1]
- self.browser.xpath('html/body/div[1]/div/div/div[2]/form/div[2]/div/button').click()
- self.browser.xpath(".//*[@id='Email']").send_keys(user)
- self.browser.xpath(".//*[@id='next']").click()
- self.browser.xpath(".//*[@id='Passwd']").send_keys(password)
- class JoinPage(unittest.TestCase):
- def test_01_new_account_jp(self):
- with open('/home/andrey/PycharmProjects/test/jpage/accounts.csv', 'rb', ) as csvfile:
- the_file = csv.reader(csvfile, delimiter=',')
- for row in the_file:
- chrome_options = webdriver.ChromeOptions()
- chrome_options.add_argument('--incognito')
- chrome_options.add_argument('--start-maximized')
- browser = webdriver.Chrome('/home/andrey/Downloads/chromedriver',chrome_options=chrome_options)
- actions = ActionChains(browser)
- wait = WebDriverWait(browser, 20)
- browser.implicitly_wait(30)
- browser.get('http://localhost:5000')
- user = row[0]
- password = row[1]
- browser.xpath('html/body/div[1]/div/div/div[2]/form/div[2]/div/button').click()
- browser.xpath(".//*[@id='Email']").send_keys(user)
- browser.xpath(".//*[@id='next']").click()
- browser.xpath(".//*[@id='Passwd']").send_keys(password)
- DesiredCapabilities capabilities = DesiredCapabilities.chrome();
- ChromeOptions options = new ChromeOptions();
- options.addArguments("incognito");
- capabilities.setCapability(ChromeOptions.CAPABILITY, options);
- FirefoxProfile firefoxProfile = new FirefoxProfile();
- firefoxProfile.setPreference("browser.privatebrowsing.autostart", true);
- DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
- capabilities.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true);
- capabilities.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private");
- DesiredCapabilities capabilities = DesiredCapabilities.operaBlink();
- OperaOptions options = new OperaOptions();
- options.addArguments("private");
- capabilities.setCapability(OperaOptions.CAPABILITY, options);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement