Created
August 12, 2017 11:57
-
-
Save chatrapathik/d714bbd7ab5b2fd3fe30e91cea19ac32 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
class ExampleTests(unittest.TestCase): | |
def setUp(self): | |
self.driver = webdriver.Chrome() | |
def test_google_without_send_keys(self): | |
self.driver.get("http://www.google.com") | |
input_box = self.driver.find_element_by_id('lst-ib') | |
assert "Google" in self.driver.title | |
self.driver.save_screenshot('google.png') | |
def test_google_with_send_keys(self): | |
self.driver.get("http://www.google.com") | |
input_box = self.driver.find_element_by_id('lst-ib') | |
input_box.send_keys('apple', Keys.RETURN) | |
assert "Google" in self.driver.title | |
self.driver.save_screenshot('google.png') | |
def tearDown(self): | |
self.driver.close() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment