Created
February 16, 2011 19:40
-
-
Save hugs/830011 to your computer and use it in GitHub Desktop.
Revisions
-
hugs revised this gist
Mar 12, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ from selenium import webdriver # iPhone driver = webdriver.Remote(browser_name="iphone", command_executor='http://172.24.101.36:3001/hub') # Android driver = webdriver.Remote(browser_name="android", command_executor='http://127.0.0.1:8080/hub') -
hugs revised this gist
Mar 12, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ from selenium import webdriver # iPhone driver = webdriver.Remote(browser_name="iphone", command_executor='http://174.24.101.36:3001/hub') # Android driver = webdriver.Remote(browser_name="android", command_executor='http://127.0.0.1:8080/hub') -
hugs revised this gist
Feb 16, 2011 . 1 changed file with 10 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ # To install the Python client library: # pip install -U selenium # Import the Selenium 2 namespace (aka "webdriver") from selenium import webdriver # iPhone @@ -15,23 +16,26 @@ # Firefox driver = webdriver.Firefox() # ------------------------------ # The actual test scenario: Test the codepad.org code execution service. # Go to codepad.org driver.get('http://codepad.org') # Select the Python language option python_link = driver.find_elements_by_xpath("//input[@name='lang' and @value='Python']")[0] python_link.click() # Enter some text! text_area = driver.find_element_by_id('textarea') text_area.send_keys("print 'Hello,' + ' World!'") # Submit the form! submit_button = driver.find_element_by_name('submit') submit_button.click() # Make this an actual test. Isn't Python beautiful? assert "Hello, World!" in driver.get_page_source() # Close the browser! driver.quit() -
hugs revised this gist
Feb 16, 2011 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ # To install the Python client library: # pip install -U selenium from selenium import webdriver # iPhone -
There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ from selenium import webdriver # iPhone driver = webdriver.Remote(browser_name="iphone", command_executor='http://10.0.2.116:3001/hub') # Android driver = webdriver.Remote(browser_name="android", command_executor='http://127.0.0.1:8080/hub') # Google Chrome driver = webdriver.Chrome() # Firefox driver = webdriver.Firefox() # Remote (IE) driver = webdriver.Remote( browser_name="Ie", platform="any") driver.get('http://codepad.org') python_link = driver.find_elements_by_xpath("//input[@name='lang' and @value='Python']")[0] python_link.click() text_area = driver.find_element_by_id('textarea') text_area.send_keys("print 'Hello,' + ' World!'") submit_button = driver.find_element_by_name('submit') submit_button.click() "Hello, World!" in driver.get_page_source() driver.quit()