How to use the selenium-webdriver.By.name function in selenium-webdriver

To help you get started, we’ve selected a few selenium-webdriver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github everettsouthwick / amazon-auto-reload / src / sites / amazon.ts View on Github external
private async addCard(card: Card): Promise
	{
		// A driver alias so the code isn't *as* unwieldy
		const driver: ThenableWebDriver = this.browser.driver;

		await driver.findElement(By.css(".a-size-base"))
			.click();

		if (card.cardholderName !== undefined && card.expirationMonth !== undefined && card.expirationYear !== undefined)
		{
			await driver.findElement(By.name("ppw-accountHolderName"))
				.sendKeys(card.cardholderName);
			await driver.findElement(By.name("addCreditCardNumber"))
				.sendKeys(card.cardNumber);
			await driver.findElement(By.xpath(`//select[@name='ppw-expirationDate_month']/option[${card.expirationMonth}]`))
				.click();
			await driver.findElement(By.xpath(`//select[@name='ppw-expirationDate_year']/option[.=${card.expirationYear}]`))
				.click();
			await driver.findElement(By.name("ppw-widgetEvent:AddCreditCardEvent"))
				.click();

			await driver.wait(until.elementLocated(By.name("ppw-widgetEvent:SelectAddressEvent")))
				.click();
		} else
		{
			throw new Error(`${card.friendlyReference}: ${card.cardholderName}/${card.expirationMonth}/${card.expirationYear}`);
		}
github apinf / platform / .test / manageapibackend.js View on Github external
function fillMetadataFields(driver) {
    driver.findElement(By.css('#api-metadata button')).click();
    driver.findElement(By.name('organization.name')).sendKeys('Name');
    driver.findElement(By.name('organization.description')).sendKeys('Description');
    driver.findElement(By.name('contact.name')).sendKeys('Name');
    driver.findElement(By.name('contact.phone')).sendKeys('+11111111111');
    driver.findElement(By.name('contact.email')).sendKeys('aa@bb.ccc');
    driver.findElement(By.name('service.name')).sendKeys('Name');
    driver.findElement(By.name('service.description')).sendKeys('Description');
    driver.findElement(By.name('service.validSince')).sendKeys('01/01/2000');
    driver.findElement(By.name('service.validUntil')).sendKeys('01/01/2030');
    driver.findElement(By.name('service.serviceLevelAgreement')).sendKeys('Agreement');
}
github apinf / platform / .test / manageapibackend.js View on Github external
function fillMetadataFields(driver) {
    driver.findElement(By.css('#api-metadata button')).click();
    driver.findElement(By.name('organization.name')).sendKeys('Name');
    driver.findElement(By.name('organization.description')).sendKeys('Description');
    driver.findElement(By.name('contact.name')).sendKeys('Name');
    driver.findElement(By.name('contact.phone')).sendKeys('+11111111111');
    driver.findElement(By.name('contact.email')).sendKeys('aa@bb.ccc');
    driver.findElement(By.name('service.name')).sendKeys('Name');
    driver.findElement(By.name('service.description')).sendKeys('Description');
    driver.findElement(By.name('service.validSince')).sendKeys('01/01/2000');
    driver.findElement(By.name('service.validUntil')).sendKeys('01/01/2030');
    driver.findElement(By.name('service.serviceLevelAgreement')).sendKeys('Agreement');
}
github apinf / platform / .test / manageapibackend.js View on Github external
function fillMetadataFields(driver) {
    driver.findElement(By.css('#api-metadata button')).click();
    driver.findElement(By.name('organization.name')).sendKeys('Name');
    driver.findElement(By.name('organization.description')).sendKeys('Description');
    driver.findElement(By.name('contact.name')).sendKeys('Name');
    driver.findElement(By.name('contact.phone')).sendKeys('+11111111111');
    driver.findElement(By.name('contact.email')).sendKeys('aa@bb.ccc');
    driver.findElement(By.name('service.name')).sendKeys('Name');
    driver.findElement(By.name('service.description')).sendKeys('Description');
    driver.findElement(By.name('service.validSince')).sendKeys('01/01/2000');
    driver.findElement(By.name('service.validUntil')).sendKeys('01/01/2030');
    driver.findElement(By.name('service.serviceLevelAgreement')).sendKeys('Agreement');
}
github apinf / platform / .test / manageapibackend.js View on Github external
function fillMetadataFields(driver) {
    driver.findElement(By.css('#api-metadata button')).click();
    driver.findElement(By.name('organization.name')).sendKeys('Name');
    driver.findElement(By.name('organization.description')).sendKeys('Description');
    driver.findElement(By.name('contact.name')).sendKeys('Name');
    driver.findElement(By.name('contact.phone')).sendKeys('+11111111111');
    driver.findElement(By.name('contact.email')).sendKeys('aa@bb.ccc');
    driver.findElement(By.name('service.name')).sendKeys('Name');
    driver.findElement(By.name('service.description')).sendKeys('Description');
    driver.findElement(By.name('service.validSince')).sendKeys('01/01/2000');
    driver.findElement(By.name('service.validUntil')).sendKeys('01/01/2030');
    driver.findElement(By.name('service.serviceLevelAgreement')).sendKeys('Agreement');
}
github apinf / platform / .test / manageapibackend.js View on Github external
function addDocumentationLink(driver) {
    driver.findElement(By.name('documentation_link'))
        .sendKeys('https://www.google.co.in')
        .then(function(){
            driver.sleep(1000);
        });
}
github everettsouthwick / amazon-auto-reload / src / sites / amazon.ts View on Github external
await driver.wait(until.titleIs("Amazon Sign In"));

		try
		{
			await driver.findElement(By.id("ap_email"))
				.sendKeys(this.username);
		} catch
		{
			assert(await driver.findElement(By.css(".a-size-base"))
				.getText() === this.username);
		}
		await driver.findElement(By.id("ap_password"))
			.sendKeys(this.password);

		const rememberMeElement: WebElement = await driver.findElement(By.name("rememberMe"));

		if (!await rememberMeElement.isSelected())
		{
			await rememberMeElement.click();
		}

		await driver.findElement(By.id("signInSubmit"))
			.click();
	}
github everettsouthwick / amazon-auto-reload / src / sites / amazon.ts View on Github external
const driver: ThenableWebDriver = this.browser.driver;

		await driver.findElement(By.css(".a-size-base"))
			.click();

		if (card.cardholderName !== undefined && card.expirationMonth !== undefined && card.expirationYear !== undefined)
		{
			await driver.findElement(By.name("ppw-accountHolderName"))
				.sendKeys(card.cardholderName);
			await driver.findElement(By.name("addCreditCardNumber"))
				.sendKeys(card.cardNumber);
			await driver.findElement(By.xpath(`//select[@name='ppw-expirationDate_month']/option[${card.expirationMonth}]`))
				.click();
			await driver.findElement(By.xpath(`//select[@name='ppw-expirationDate_year']/option[.=${card.expirationYear}]`))
				.click();
			await driver.findElement(By.name("ppw-widgetEvent:AddCreditCardEvent"))
				.click();

			await driver.wait(until.elementLocated(By.name("ppw-widgetEvent:SelectAddressEvent")))
				.click();
		} else
		{
			throw new Error(`${card.friendlyReference}: ${card.cardholderName}/${card.expirationMonth}/${card.expirationYear}`);
		}
	}
github KnowledgeExpert / selenidejs / lib / support / selectors / by.ts View on Github external
export function name(name: string): By {
        return By.name(name);
    }