本文整理汇总了TypeScript中selenium-webdriver.WebElement类的典型用法代码示例。如果您正苦于以下问题:TypeScript WebElement类的具体用法?TypeScript WebElement怎么用?TypeScript WebElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WebElement类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: TestWebElement
function TestWebElement() {
let driver: webdriver.WebDriver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
let element: webdriver.WebElement;
element = new webdriver.WebElement(driver, 'elementId');
element = new webdriver.WebElement(driver, promise);
let voidPromise: webdriver.promise.Promise<void>;
let stringPromise: webdriver.promise.Promise<string>;
let booleanPromise: webdriver.promise.Promise<boolean>;
voidPromise = element.clear();
voidPromise = element.click();
element = element.findElement(webdriver.By.id('ABC'));
element = element.findElement({id: 'ABC'});
element.findElements({className: 'ABC'}).then((elements: webdriver.WebElement[]) => { });
stringPromise = element.getAttribute('class');
stringPromise = element.getCssValue('display');
driver = element.getDriver();
element.getLocation().then((location: webdriver.ILocation) => {});
element.getSize().then((size: webdriver.ISize) => {});
stringPromise = element.getTagName();
stringPromise = element.getText();
booleanPromise = element.isDisplayed();
booleanPromise = element.isEnabled();
booleanPromise = element.isSelected();
voidPromise = element.sendKeys('A', 'B', 'C');
voidPromise = element.sendKeys(1, 2, 3);
voidPromise = element.sendKeys(webdriver.Key.BACK_SPACE);
voidPromise = element.sendKeys(stringPromise, stringPromise, stringPromise);
voidPromise = element.sendKeys('A', 1, webdriver.Key.BACK_SPACE, stringPromise);
voidPromise = element.submit();
element.getId().then((id: string) => {});
element.serialize().then((id: webdriver.IWebElementId) => {});
booleanPromise = webdriver.WebElement.equals(element, new webdriver.WebElement(driver, 'elementId'));
}
开发者ID:Rick-Kirkham,项目名称:DefinitelyTyped,代码行数:42,代码来源:index.ts
示例2: TestWebElement
function TestWebElement() {
var driver: webdriver.WebDriver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
var promise: webdriver.promise.Promise<string>;
var element: webdriver.WebElement;
element = new webdriver.WebElement(driver, 'elementId');
element = new webdriver.WebElement(driver, promise);
var voidPromise: webdriver.promise.Promise<void>;
var stringPromise: webdriver.promise.Promise<string>;
var booleanPromise: webdriver.promise.Promise<boolean>;
voidPromise = element.clear();
voidPromise = element.click();
element = element.findElement(webdriver.By.id('ABC'));
element.findElements(webdriver.By.className('ABC')).then(function (elements: webdriver.WebElement[]) { });
booleanPromise = element.isElementPresent(webdriver.By.className('ABC'));
stringPromise = element.getAttribute('class');
stringPromise = element.getCssValue('display');
driver = element.getDriver();
stringPromise = element.getInnerHtml();
element.getLocation().then(function (location: webdriver.ILocation) { });
stringPromise = element.getOuterHtml();
element.getSize().then(function (size: webdriver.ISize) { });
stringPromise = element.getTagName();
stringPromise = element.getText();
booleanPromise = element.isDisplayed();
booleanPromise = element.isEnabled();
booleanPromise = element.isSelected();
voidPromise = element.sendKeys('A', 'B', 'C');
voidPromise = element.sendKeys(stringPromise, stringPromise, stringPromise);
voidPromise = element.submit();
element.getId().then(function (id: string) { });
element.getRawId().then(function (id: string) { });
element.serialize().then(function (id: webdriver.IWebElementId) { });
booleanPromise = webdriver.WebElement.equals(element, new webdriver.WebElement(driver, 'elementId'));
}
开发者ID:KostyaTretyak,项目名称:DefinitelyTyped,代码行数:43,代码来源:selenium-webdriver-tests.ts
注:本文中的selenium-webdriver.WebElement类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论