i run appium
iphone test command mocha ios-safari.js
, gives error:
the environment requested unavailable
where ios-safari.js
example downloaded appium samples
:
"use strict"; require("./helpers/setup"); var wd = require("wd"), _ = require('underscore'), serverconfigs = require('./helpers/appium-servers'); describe("ios safari", function () { this.timeout(300000); var driver; var allpassed = true; before(function () { var serverconfig = process.env.sauce ? serverconfigs.sauce : serverconfigs.local; driver = wd.promisechainremote(serverconfig); require("./helpers/logging").configure(driver); var desired = _.clone(require("./helpers/caps").ios81); desired.browsername = 'safari'; if (process.env.sauce) { desired.name = 'ios - safari'; desired.tags = ['sample']; } return driver.init(desired); }); after(function () { return driver .quit() .finally(function () { if (process.env.sauce) { return driver.saucejobstatus(allpassed); } }); }); aftereach(function () { allpassed = allpassed && this.currenttest.state === 'passed'; }); it("should url", function () { return driver .get('https://www.google.com') .sleep(1000) .waitforelementbyname('q', 5000) .sendkeys('sauce labs') .sendkeys(wd.special_keys.return) .sleep(1000) .title().should.eventually.include('sauce labs'); }); it("should delete cookie passing domain , path", function () { var complexcookiedelete = function(name, path, domain) { return function() { path = path || '|'; return driver.setcookie({name: name, value: '', path: path, domain: domain, expiry: 0}); }; }; return driver .get('http://en.wikipedia.org') .waitforelementbycss('.mediawiki', 5000) .allcookies() // 'geoip' cookie there .deletecookie('geoip') .allcookies() // 'geoip' still there, because set on // .wikipedia.org domain .then(complexcookiedelete('geoip', '/', '.wikipedia.org')) .allcookies() // 'geoip' cookie gone .sleep(1000); }); });
the appium
log following:
info: [debug] error: not find device launch. requested 'iphone 6 (8.1 simulator)', available devices were: [ "ipad 2 (8.3 simulator) [2f86d724-b8d6-4f22-b5e8-97b437c9acfb]", "ipad air (8.3 simulator) [8a07b826-af59-4fc4-bc8e-21b37adaf539]", "ipad retina (8.3 simulator) [9c589cb6-1cf4-437e-83db-1270db1599fc]", "iphone 4s (8.3 simulator) [31f567a4-5346-4e1a-b414-c45062105964]", "iphone 5 (8.3 simulator) [e820b152-b5b4-4a79-b9de-3a1f49859662]", "iphone 5s (8.3 simulator) [5a07ebe7-264a-4571-ba9e-1f17c882ade3]", "iphone 6 (8.3 simulator) [58856942-bd3f-45c6-9b1b-93102851b37e]", "iphone 6 plus (8.3 simulator)
since recenlty have updated x code
last version seemingly should change device name somewhere in config iphone 6 (8.1 simulator)
iphone 6 (8.3 simulator) [58856942-bd3f-45c6-9b1b-93102851b37e]
. should - cannot figure out.
you specify target device when start appium session. on command line, use '--device-name' parameter. in appium ui, specify device want there in ios tab. i've found bit finicky name. i've had success being general necessary differentiate between devices. iow, try 'iphone 6' or 'iphone 5 (8.3 simulator)' instead of entire string.
Comments
Post a Comment