當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Builder.forBrowser方法代碼示例

本文整理匯總了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();
}
開發者ID:Rick-Kirkham,項目名稱:DefinitelyTyped,代碼行數:33,代碼來源:index.ts

示例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 });
}
開發者ID:Lavoaster,項目名稱:DefinitelyTyped,代碼行數:22,代碼來源:index.ts

示例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 });
}
開發者ID:ArtemZag,項目名稱:DefinitelyTyped,代碼行數:24,代碼來源:index.ts


注:本文中的selenium-webdriver.Builder.forBrowser方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。