当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript until.elementLocated方法代码示例

本文整理汇总了TypeScript中selenium-webdriver.until.elementLocated方法的典型用法代码示例。如果您正苦于以下问题:TypeScript until.elementLocated方法的具体用法?TypeScript until.elementLocated怎么用?TypeScript until.elementLocated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在selenium-webdriver.until的用法示例。


在下文中一共展示了until.elementLocated方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: TestUntilModule

function TestUntilModule() {
    let driver: webdriver.WebDriver = new webdriver.Builder().
        withCapabilities(webdriver.Capabilities.chrome()).
        build();

    let conditionB: webdriver.Condition<boolean> = new webdriver.Condition<boolean>('message', (driver: webdriver.WebDriver) => true);
    let conditionBBase: webdriver.Condition<boolean> = conditionB;
    let conditionWebElement: webdriver.WebElementCondition;
    let conditionWebElements: webdriver.Condition<webdriver.WebElement[]>;

    conditionB = webdriver.until.ableToSwitchToFrame(5);
    let conditionAlert: webdriver.Condition<webdriver.Alert> = webdriver.until.alertIsPresent();
    let el: webdriver.WebElement = driver.findElement(webdriver.By.id('id'));
    conditionB = webdriver.until.stalenessOf(el);
    conditionB = webdriver.until.titleContains('text');
    conditionB = webdriver.until.titleIs('text');
    conditionB = webdriver.until.titleMatches(/text/);
    conditionB = webdriver.until.urlContains('text');
    conditionB = webdriver.until.urlIs('text');
    conditionB = webdriver.until.urlMatches(/text/);

    conditionWebElement = webdriver.until.elementIsDisabled(el);
    conditionWebElement = webdriver.until.elementIsEnabled(el);
    conditionWebElement = webdriver.until.elementIsNotSelected(el);
    conditionWebElement = webdriver.until.elementIsNotVisible(el);
    conditionWebElement = webdriver.until.elementIsSelected(el);
    conditionWebElement = webdriver.until.elementIsVisible(el);
    conditionWebElement = webdriver.until.elementLocated(webdriver.By.id('id'));
    conditionWebElement = webdriver.until.elementTextContains(el, 'text');
    conditionWebElement = webdriver.until.elementTextIs(el, 'text');
    conditionWebElement = webdriver.until.elementTextMatches(el, /text/);
    conditionWebElements = webdriver.until.elementsLocated(webdriver.By.className('class'));
}
开发者ID:Rick-Kirkham,项目名称:DefinitelyTyped,代码行数:33,代码来源:index.ts

示例2: return

 return () => {
     // self._driver.get(page.URL);
     self._driver.findElement(By.css(page.LOGIN)).sendKeys('wronglogin@test.test');
     self._driver.findElement(By.css(page.PASS)).sendKeys('159236');
     self._driver.findElement(By.css(page.SUBMIT)).click();
     self._driver.wait(until.elementLocated(By.css(page.ERROR)));
     self._driver.quit();
 };
开发者ID:natalialin,项目名称:Pult-autotests,代码行数:8,代码来源:login-negative.ts

示例3: _getRatesForIndicative

    private _getRatesForIndicative(skipOptionClick) {
        var promises = [];
        if (!skipOptionClick) {
            promises.push(this._waitAndClick(By.xpath(`//*[@id='nonINRradio']/*[@id='moneyType']`)));
        }
        promises.push(driver.wait(until.elementLocated(By.xpath(`//*[@id="txnAmountDiv1"]/input`)), 5 * 1000)
            .then(el => el.sendKeys('1000')));
        promises.push(this._waitAndClick(By.xpath(`//a[@onclick='calculate();']`)));

        return promise.all(promises)
            .then(_ => this._extractRates(true))
            .then(resultPromise => promise.all(resultPromise));
    }
开发者ID:vmanikandan001,项目名称:xcngr,代码行数:13,代码来源:m2indiaProvider.ts

示例4: _getIndicativeRate

    private _getIndicativeRate(pageMap) {
        driver.get(URL);
     

        driver.wait(until.elementLocated(By.css("#paymentAmount")), 5 * 1000)
            .then(el => el.sendKeys("1"));
            
             //  driver.wait(until.elementLocated(By.xpath(`//*[@id="paymentCurrencies"]/option[text()="${pageMap.currencyValue}"]`)), 15 * 1000)
            //.then(el => el.click());

        driver.findElement(By.xpath(`//*[@id='deliveryCountries']/option[text()='India']`))
             .then(el => el.click())

        // driver.findElement(By.css("#deliveryAmount"))
        //     .then(el => el.getText().then(text => console.log(text)));
    }
开发者ID:vmanikandan001,项目名称:xcngr,代码行数:16,代码来源:xendpayProvider.ts

示例5: _waitAndClick

 private _waitAndClick(locator: webdriver.Locator) {
     return driver.wait(until.elementLocated(locator), 5 * 1000)
         .then(el => el.click());
 }
开发者ID:vmanikandan001,项目名称:xcngr,代码行数:4,代码来源:m2indiaProvider.ts

示例6: waitToLocateIWE

 public waitToLocateIWE(locator: string): any {
   return this._driver.wait(until.elementLocated(By.css(locator)), 2000);
 }
开发者ID:natalialin,项目名称:Pult-autotests,代码行数:3,代码来源:page.ts

示例7: reverseTodos

 public static async reverseTodos() {
   await browser.wait(until.elementLocated(By.css(cssSelectors.reverseTodosButton)), 1000);
   log(`click Reverse todos`);
   await this.reverseTodosButton.click();
 }
开发者ID:aurelia,项目名称:aurelia,代码行数:5,代码来源:app.page.ts

示例8: addTodo

 public static async addTodo() {
   await browser.wait(until.elementLocated(By.css(cssSelectors.addTodoButton)), 1000);
   log(`click Add todo`);
   await this.addTodoButton.click();
 }
开发者ID:aurelia,项目名称:aurelia,代码行数:5,代码来源:app.page.ts

示例9: getCountInputValue

 public static async getCountInputValue() {
   await browser.wait(until.elementLocated(By.css(cssSelectors.descriptionInput)), 1000);
   return parseInt((await this.countInput.getAttribute('value')), 10);
 }
开发者ID:aurelia,项目名称:aurelia,代码行数:4,代码来源:app.page.ts

示例10: setCountInputValue

 public static async setCountInputValue(value: number) {
   await browser.wait(until.elementLocated(By.css(cssSelectors.countInput)), 1000);
   log(`set count value to ${value}`);
   await this.countInput.clear();
   await this.countInput.sendKeys(value);
 }
开发者ID:aurelia,项目名称:aurelia,代码行数:6,代码来源:app.page.ts


注:本文中的selenium-webdriver.until.elementLocated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。