Skip to content

Commit

Permalink
Fix selectElement example test. (nightwatchjs#4233)
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 authored and dikwickley committed Aug 6, 2024
1 parent 3455351 commit 4529d2b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/tests/selectElement.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
const {Select} = require('selenium-webdriver');

module.exports = {
before(browser) {
browser.url('https://www.selenium.dev/selenium/web/formPage.html');
},

async demoTest(browser) {
const selectElement = browser.element('select[name=selectomatic]');

await browser
.url('https://www.selenium.dev/selenium/web/formPage.html')
.perform(async function() {
const select = new Select(selectElement);
const selectWebElement = await selectElement; // `Select` class expects a WebElement

const select = new Select(selectWebElement);

await select.selectByVisibleText('Four');
})
Expand Down

0 comments on commit 4529d2b

Please sign in to comment.