本文整理匯總了TypeScript中selenium-webdriver.Builder.forBrowser方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Builder.forBrowser方法的具體用法?TypeScript Builder.forBrowser怎麽用?TypeScript Builder.forBrowser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類selenium-webdriver.Builder
的用法示例。
在下文中一共展示了Builder.forBrowser方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: TestBuilder
function TestBuilder() {
let builder: webdriver.Builder = new webdriver.Builder();
let driver: webdriver.WebDriver = builder.build();
builder = builder.forBrowser('name');
builder = builder.forBrowser('name', 'version');
builder = builder.forBrowser('name', 'version', 'platform');
let cap: webdriver.Capabilities = builder.getCapabilities();
let str: string = builder.getServerUrl();
builder = builder.setAlertBehavior('behavior');
builder = builder.setChromeOptions(new chrome.Options());
builder = builder.setChromeService(new chrome.ServiceBuilder());
builder = builder.setControlFlow(new webdriver.promise.ControlFlow());
builder = builder.setEdgeOptions(new edge.Options());
builder = builder.setEdgeService(new edge.ServiceBuilder());
builder = builder.setEnableNativeEvents(true);
builder = builder.setFirefoxOptions(new firefox.Options());
builder = builder.setFirefoxService(new firefox.ServiceBuilder());
builder = builder.setLoggingPrefs(new webdriver.logging.Preferences());
builder = builder.setLoggingPrefs({ key: 'value' });
builder = builder.setProxy({ proxyType: 'type' });
builder = builder.setSafariOptions(new safari.Options());
builder = builder.setScrollBehavior(1);
builder = builder.usingServer('http://someserver');
builder = builder.withCapabilities(new webdriver.Capabilities());
builder = builder.withCapabilities({ something: true });
const chromeOptions: chrome.Options = builder.getChromeOptions();
const firefoxOptions: firefox.Options = builder.getFirefoxOptions();
const safariOptions: safari.Options = builder.getSafariOptions();
}
示例2: TestBuilder
function TestBuilder() {
let builder: webdriver.Builder = new webdriver.Builder();
let driver: webdriver.WebDriver = builder.build();
builder = builder.forBrowser('name');
builder = builder.forBrowser('name', 'version');
builder = builder.forBrowser('name', 'version', 'platform');
let cap: webdriver.Capabilities = builder.getCapabilities();
let str: string = builder.getServerUrl();
builder = builder.setAlertBehavior('behavior');
builder = builder.setChromeOptions(new chrome.Options());
builder = builder.setEdgeOptions(new edge.Options());
builder = builder.setFirefoxOptions(new firefox.Options());
builder = builder.setLoggingPrefs(new webdriver.logging.Preferences());
builder = builder.setLoggingPrefs({ key: 'value' });
builder = builder.setProxy({ proxyType: 'type' });
builder = builder.usingServer('http://someserver');
builder = builder.withCapabilities(new webdriver.Capabilities());
builder = builder.withCapabilities({ something: true });
}
示例3: TestBuilder
function TestBuilder() {
var builder: webdriver.Builder = new webdriver.Builder();
var driver: webdriver.WebDriver = builder.build();
builder = builder.forBrowser('name');
builder = builder.forBrowser('name', 'version');
builder = builder.forBrowser('name', 'version', 'platform');
var cap: webdriver.Capabilities = builder.getCapabilities();
var str: string = builder.getServerUrl();
builder = builder.setAlertBehavior('behavior');
builder = builder.setChromeOptions(new chrome.Options());
builder = builder.setControlFlow(new webdriver.promise.ControlFlow());
builder = builder.setEnableNativeEvents(true);
builder = builder.setFirefoxOptions(new firefox.Options());
builder = builder.setLoggingPrefs(new webdriver.logging.Preferences());
builder = builder.setLoggingPrefs({ 'key': 'value' });
builder = builder.setProxy({ proxyType: 'type' });
builder = builder.setScrollBehavior(1);
builder = builder.usingServer('http://someserver');
builder = builder.withCapabilities(new webdriver.Capabilities());
builder = builder.withCapabilities({ something: true });
}