本文整理汇总了TypeScript中selenium-webdriver.Options.logs方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Options.logs方法的具体用法?TypeScript Options.logs怎么用?TypeScript Options.logs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类selenium-webdriver.Options
的用法示例。
在下文中一共展示了Options.logs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: TestWebDriverOptions
function TestWebDriverOptions() {
let driver: webdriver.WebDriver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
let options: webdriver.Options = new webdriver.Options(driver);
let promise: webdriver.promise.Promise<void>;
let name: string = 'name';
let value: string = 'value';
let path: string = 'path';
let domain: string = 'domain';
let secure: boolean = true;
let httpOnly: boolean = true;
// Add Cookie
promise = options.addCookie({ name, value });
promise = options.addCookie({ name, value, path });
promise = options.addCookie({ name, value, path, domain });
promise = options.addCookie({ name, value, path, domain, secure });
promise = options.addCookie({ name, value, path, domain, secure, httpOnly });
promise = options.addCookie({ name, value, path, domain, secure, httpOnly, expiry: 123 });
promise = options.addCookie({ name, value, path, domain, secure, httpOnly, expiry: Date.now() });
promise = options.deleteAllCookies();
promise = options.deleteCookie('name');
options.getCookie('name').then((cookie: webdriver.IWebDriverCookie) => {
let expiry: number | undefined = cookie.expiry;
});
options.getCookies().then((cookies: webdriver.IWebDriverCookie[]) => { });
let logs: webdriver.Logs = options.logs();
let timeouts: webdriver.Timeouts = options.timeouts();
let window: webdriver.Window = options.window();
}
示例2: TestWebDriverOptions
function TestWebDriverOptions() {
var driver: webdriver.WebDriver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
var options: webdriver.Options = new webdriver.Options(driver);
var promise: webdriver.promise.Promise<void>;
// Add Cookie
promise = options.addCookie('name', 'value');
promise = options.addCookie('name', 'value', 'path');
promise = options.addCookie('name', 'value', 'path', 'domain');
promise = options.addCookie('name', 'value', 'path', 'domain', true);
promise = options.addCookie('name', 'value', 'path', 'domain', true, 123);
promise = options.addCookie('name', 'value', 'path', 'domain', true, Date.now());
promise = options.deleteAllCookies();
promise = options.deleteCookie('name');
options.getCookie('name').then(function (cookies: webdriver.IWebDriverOptionsCookie) { });
options.getCookies().then(function (cookies: webdriver.IWebDriverOptionsCookie[]) { });
var logs: webdriver.Logs = options.logs();
var timeouts: webdriver.Timeouts = options.timeouts();
var window: webdriver.Window = options.window();
}