Skip to content

Instantly share code, notes, and snippets.

@dudepare
Created September 20, 2015 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dudepare/066a892ce032d6a844f6 to your computer and use it in GitHub Desktop.
Save dudepare/066a892ce032d6a844f6 to your computer and use it in GitHub Desktop.
import unittest
from selenium import webdriver
class CountFilled(unittest.TestCase):
def setUp(self):
self.driver = webdriver.PhantomJS()
def test_count_filled(self):
self.driver.get("http://apply.dataprocessors.com.au/")
self.driver.find_element_by_xpath("//form/p[1]/input").send_keys("PO65")
self.driver.find_element_by_xpath("//form/p[3]/input").send_keys("{}".format(self.driver.page_source.count('"fi')))
self.driver.find_element_by_xpath("//form/p[4]/input").click()
def tearDown(self):
print(self.driver.page_source)
self.driver.close()
if __name__ == "__main__":
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment