本文整理汇总了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'));
}
示例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();
};
示例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));
}
示例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)));
}
示例5: _waitAndClick
private _waitAndClick(locator: webdriver.Locator) {
return driver.wait(until.elementLocated(locator), 5 * 1000)
.then(el => el.click());
}
示例6: waitToLocateIWE
public waitToLocateIWE(locator: string): any {
return this._driver.wait(until.elementLocated(By.css(locator)), 2000);
}
示例7: reverseTodos
public static async reverseTodos() {
await browser.wait(until.elementLocated(By.css(cssSelectors.reverseTodosButton)), 1000);
log(`click Reverse todos`);
await this.reverseTodosButton.click();
}
示例8: addTodo
public static async addTodo() {
await browser.wait(until.elementLocated(By.css(cssSelectors.addTodoButton)), 1000);
log(`click Add todo`);
await this.addTodoButton.click();
}
示例9: getCountInputValue
public static async getCountInputValue() {
await browser.wait(until.elementLocated(By.css(cssSelectors.descriptionInput)), 1000);
return parseInt((await this.countInput.getAttribute('value')), 10);
}
示例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);
}