-
Notifications
You must be signed in to change notification settings - Fork 23
Frequently Asked Questions (FAQ)
https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/
Nemo wraps this API, and you should reference it in order to fully control your web browser sessions. Nemo itself only has a few convenience methods. The Selenium WebDriver API has the rest!
You can construct your driver configuration in this manner (note the args
array):
"driver": {
"builders": {
"withCapabilities": [
{
"browserName": "chrome",
"chromeOptions": {
"args": [
"headless",
"window-size=1200,800",
"disable-dev-shm-usage"
]
}
}
]
}
},
For a list of Chromium command line switches, please see: https://peter.sh/experiments/chromium-command-line-switches/
Sometimes, just waiting for an element to be visible in the DOM isn't enough. This is because your application requires JavaScript event handlers to provide interaction behavior. In these cases, you need to determine some event or global variable that is fired/available before proceeding with your test.
You can do something like this:
await nemo.driver.wait(() => {
return nemo.driver.executeScript(() => {
return !!window.domReady;
})
}, 8000);
The !!window.domReady
command will return true once the global variable is set on the DOM. You can replace this test with whatever test will return true once your JavaScript is loaded.