本文整理汇总了TypeScript中selenium-webdriver.WebElement.sendKeys方法的典型用法代码示例。如果您正苦于以下问题:TypeScript WebElement.sendKeys方法的具体用法?TypeScript WebElement.sendKeys怎么用?TypeScript WebElement.sendKeys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类selenium-webdriver.WebElement
的用法示例。
在下文中一共展示了WebElement.sendKeys方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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(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(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'));
}
示例2: 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');
let voidPromise: Promise<void>;
let stringPromise: Promise<string>;
let booleanPromise: 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'));
}