from selenium import webdriver# iPhonedriver = webdriver.Remote(browser_name="iphone", command_executor='http://172.24.101.36:3001/hub')# Androiddriver = webdriver.Remote(browser_name="android", command_executor='http://127.0.0.1:8080/hub')# Google Chromedriver = webdriver.Chrome()# Firefoxdriver = webdriver.Firefox()# ------------------------------# The actual test scenario: Test the codepad.org code execution service.# Go to codepad.orgdriver.get('http://codepad.org')# Select the Python language optionpython_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()
This Blog is just for Educational Purpose. This Blog provide information about python and python frameworks : Django, Selenium, Scrapy etc.
Pages
- Home
- 0. Getting Started with Selenium
- 1. Moving To a Selenium Example
- 2. Clear Concept Using Python Selenium
- 3. Creating Test Cases Using Python and Unittest IN Selenium
- 4. Python Webdriver API's
- 5.Locating Elements On a Web Page
- 6. Selenium Examples For YOu
- 7. How to Choose Programming Language - Selenium
Selenium Example for iphone and android
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment