.window.setPosition() Suggest edits
Set the position of the current window - move the window to the chosen position.
Usage
.window.setPosition(x, y, [callback])
Example
module.exports = {
'set current window position': function (browser) {
// Move the window to the top left of the primary monitor
browser.window.setPosition(0, 0, function (result) {
console.log('window moved successfully');
});
},
'set current window position using ES6 async/await': async function (browser) {
// Move the window to the top left of the primary monitor
await browser.window.setPosition(0, 0);
}
}
Parameters
Name | Type | description |
---|---|---|
x |
number | New x-coordinate of the top-left corner of the window. |
y |
number | New y-coordinate of the top-left corner of the window. |
callback Optional |
function | Optional callback function to be called when the command finishes. |