Skip to content

Instantly share code, notes, and snippets.

@DominikDary
Created January 9, 2014 10:01
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 DominikDary/8331957 to your computer and use it in GitHub Desktop.
Save DominikDary/8331957 to your computer and use it in GitHub Desktop.
import unittest
from selenium import webdriver
class Bug167(unittest.TestCase):
def setUp(self):
desired_capabilities = {'aut': 'io.selendroid.testapp:0.7.0','androidTarget':'ANDROID19'}
self.driver = webdriver.Remote(
desired_capabilities=desired_capabilities,
command_executor="http://127.0.0.1:5555/wd/hub"
)
def test_find_element_by_id(self):
self.driver.get('and-activity://io.selendroid.testapp.HomeScreenActivity')
self.assertTrue("and-activity://HomeScreenActivity" in self.driver.current_url)
self.driver.find_element_by_id('buttonStartWebView').click()
self.driver.find_element_by_class_name("android.webkit.WebView")
self.driver.switch_to_window("WEBVIEW")
field = self.driver.find_element_by_id("name_input")
def tearDown(self):
self.driver.quit()
if __name__ == '__main__':
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment