问题描述
- webdriver下使用 js应该如何隐藏Safari的地址栏啊?
-
"use strict";var wd = require("wd");
require('colors');
var chai = require("chai");
var chaiAsPromised = require("chai-as-promised");
chai.use(chaiAsPromised);
chai.should();
chaiAsPromised.transferPromiseness = wd.transferPromiseness;var desired = {
'appium-version': '1.0',
platformName: 'iOS',
platformVersion: '8.1',
deviceName: 'iPad51',
browserName: "Safari",
name: "Appium Safari: with WD",
newCommandTimeout: 600000
};var browser = wd.promiseChainRemote("localhost", 4723);
// See whats going on
browser.on('status', function (info) {
console.log(info.cyan);
});browser.on('command', function (meth, path, data) {
console.log(' > ' + meth.yellow, path.grey, data || '');
});browser
.init(desired)
.then(function () {
browser
.get("http://3.136.142.136:9000")
.sleep(5000)/*login system name with "insite" ,password with "2getin"*/
.elementByClassName('login-textfield')
.sendKeys("insite")
.elementByName('password')
.sendKeys("2getin")
.sleep(2000)
.elementById('login-button')
.click()/*Switch to imageViewer*/
.sleep(10000)
.elementById('imageBrowserTab')
.click()
.sleep(5000).fin(function () { return browser .sleep(3000) .quit(); });
})
.catch(function (err) {
console.log(err);
throw err;
})
.done();以上是代码,应该如何添加代码实现隐藏Safari地址栏????急求!!感谢