Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
42 lines (30 loc) · 1.22 KB

File metadata and controls

42 lines (30 loc) · 1.22 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""An example of Appium running on Sauce, with a webview.
This test assumes SAUCE_USERNAME and SAUCE_ACCESS_KEY are environment variables
set to your Sauce Labs username and access key."""
from random import randint
from appium import webdriver
from appium import SauceTestCase, on_platforms
from time import sleep
from selenium.webdriver.common.keys import Keys
app = 'http://appium.s3.amazonaws.com/WebViewApp6.0.app.zip'
platforms = [{
'platformName': 'iOS',
'platformVersion': '7.1',
'deviceName': 'iPhone Simulator',
'appiumVersion': '1.3.4',
'app': app
}]
@on_platforms(platforms)
class WebViewIOSSauceTests(SauceTestCase):
def test_get_url(self):
url_el = self.driver.find_element_by_xpath('//UIAApplication[1]/UIAWindow[1]/UIATextField[1]')
url_el.send_keys('http://www.google.com')
go_el = self.driver.find_element_by_accessibility_id('Go')
go_el.click()
self.driver.switch_to.context('WEBVIEW')
search = self.driver.find_element_by_name('q')
search.send_keys('sauce labs')
search.send_keys(Keys.RETURN)
# allow the page to load
sleep(1)
self.assertEquals('sauce labs', self.driver.title[:10])
Morty Proxy This is a proxified and sanitized view of the page, visit original site.