Getting this error : unknown command: session/0560573d012ab858001aaea2ae11fcb0/window/rect
See original GitHub issueI am using window.maximize() in my codeceptj.json file and when my very first test runs then it gets failed with this error : unknown command: session/0560573d012ab858001aaea2ae11fcb0/window/rect
I am using latest ChromeDriver Version 2.33 and running my tests on Chrome Version 63.0.3239.132 (Official Build) (64-bit)
unknown command: session/0560573d012ab858001aaea2ae11fcb0/window/rect
@APshenkin @DavertMik : Please help me in this
# paste output here
Provide test source code if related
// paste test
Details
- CodeceptJS version:
- NodeJS Version:
- Operating System:windows 10
- Protractor || WebDriverIO || Nightmare version (if related)
- Configuration file:
# paste suite config here
{
"output": "./output",
"helpers": {
"WebDriverIO": {
"url": "https://formsviewertest.azurewebsites.net",
"browser": "chrome",
"windowSize": "maximize",
"restart": false,
"keepBrowserState": true,
"keepCookies": true
},
"TabSwitch": {
"require": "./tabswitch_helper.js"
}
},
"include": {
"I": "./steps_file.js",
"loginPagePage": "./pages/loginPage.js",
"manageCredentialPage": "./pages/manageCredential.js",
"templatePage": "./pages/template.js",
"uiHelper": "./pages/uiHelper.js",
"fvAssert": "./pages/fvAssert.js",
"listPage": "./pages/listPage.js",
"fvData": "./InputData/login.js"
},
"mocha": {
"reporterOptions": {
"codeceptjs-cli-reporter": {
"stdout": "-",
"options": {
"verbose": false,
"steps": true
}
},
"mocha-junit-reporter": {
"stdout": "./output/console.log",
"options": {
"mochaFile": "./output/result.xml"
}
}
}
},
"bootstrap": "./config/start_server.js",
"teardown": "./config/stop_server.js",
"hooks": [],
"tests": "**/fv_*_test.js",
"timeout": 10000,
"name": "FV"
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:10
Top Results From Across the Web
Error while installing react JS wiht the message: Unknown ...
I got this trouble when I try to install react JS with my npm. this is the massage: Unknown command: "create-react-app" To see...
Read more >"Unknown command" error when trying to debug a python ...
open 'bug' folder on VS; on Solution Explorer, right click on test.py and choose Debug.
Read more >error: unknown command 'run-android'. : r/reactnative - Reddit
error : unknown command 'run-android'. It's my first time making a react project. I was able to run npx react-native start but couldn't...
Read more >Error while installing latest devstack - Google Groups
here i'm posting the error log appeared during the installation of edx developer stack. ... default: Unknown command: 'create_oauth2_client'.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@reubenmiller : I did this but I am getting the same error.I am just pasting below the webdriverIO file after edit that you ask me to do.
let webdriverio; const requireg = require(‘requireg’); const Helper = require(‘…/helper’); const stringIncludes = require(‘…/assert/include’).includes; const { urlEquals, equals } = require(‘…/assert/equal’); const empty = require(‘…/assert/empty’).empty; const truth = require(‘…/assert/truth’).truth; const { xpathLocator, fileExists, clearString, decodeUrl, chunkArray, } = require(‘…/utils’); const ElementNotFound = require(‘./errors/ElementNotFound’); const assert = require(‘assert’); const path = require(‘path’);
const webRoot = ‘body’; const Locator = require(‘…/locator’);
let withinStore = {};
/**
Configuration
url
- base url of website to be testedbrowser
- browser in which perform testingrestart
(optional, default: true) - restart browser between tests.smartWait
: (optional) enables SmartWait; wait for additional milliseconds for element to appear. Enable for 5 secs: “smartWait”: 5000disableScreenshots
(optional, default: false) - don’t save screenshot on failureuniqueScreenshotNames
(optional, default: false) - option to prevent screenshot override if you have scenarios with the same name in different suiteskeepBrowserState
(optional, default: false) - keep browser state between tests whenrestart
set to false.keepCookies
(optional, default: false) - keep cookies between tests whenrestart
set to false.windowSize
: (optional) default window size. Set tomaximize
or a dimension in the format640x480
.waitForTimeout
: (option) sets default wait time in ms for allwait*
functions. 1000 by default;desiredCapabilities
: Selenium’s [desiredmanualStart
(optional, default: false) - do not start browser before a test, start it manually inside a helperthis.helpers["WebDriverIO"]._startBrowser()
timeouts
: WebDriverIO timeouts defined as hash.Headless Chrome
Connect through proxy
helpers.WebDriverIO.desiredCapabilities.proxy
key.Cloud Providers
Sauce Labs
BrowserStack
TestingBot
BrowserStack
andSauce Labs
is simple. All you need to douser
andkey
parameters. WebDriverIO automatically know whichMultiremote Capabilities
Access From Helpers
browser
property:*/ class WebDriverIO extends Helper { constructor(config) { super(config); webdriverio = requireg(‘webdriverio’);
}
_validateConfig(config) { // set defaults this.root = webRoot;
}
static _checkRequirements() { try { requireg(‘webdriverio’); } catch (e) { return [‘webdriverio’]; } }
static _config() { return [{ name: ‘url’, message: ‘Base url of site to be tested’, default: ‘http://localhost’, }, { name: ‘browser’, message: ‘Browser in which testing will be performed’, default: ‘chrome’, }]; }
_beforeSuite() { if (!this.options.restart && !this.options.manualStart && !this.isRunning) { this.debugSection(‘Session’, ‘Starting singleton browser session’); return this._startBrowser(); } }
async _startBrowser() { if (this.options.multiremote) { this.browser = webdriverio.multiremote(this.options.multiremote).init(); } else { this.browser = webdriverio.remote(this.options).init(); } await this.browser; this.isRunning = true; if (this.options.timeouts) { await this.defineTimeout(this.options.timeouts); }
}
async _before() { this.context = this.root; if (this.options.restart && !this.options.manualStart) return this._startBrowser(); if (!this.isRunning && !this.options.manualStart) return this._startBrowser(); return this.browser; }
async _after() { if (!this.isRunning) return; if (this.options.restart) { this.isRunning = false; return this.browser.end(); }
}
_afterSuite() { }
_finishTest() { if (!this.options.restart && this.isRunning) return this.browser.end(); }
async _failed(test) { if (Object.keys(withinStore).length !== 0) await this._withinEnd(); if (!this.options.disableScreenshots) { let fileName = clearString(test.title); if (test.ctx && test.ctx.test && test.ctx.test.type === ‘hook’) fileName = clearString(
${test.title}_${test.ctx.test.title}
); if (this.options.uniqueScreenshotNames) { const uuid = test.uuid || test.ctx.test.uuid; fileName =${fileName.substring(0, 10)}_${uuid}.failed.png
; } else { fileName += ‘.failed.png’; } await this.saveScreenshot(fileName, this.options.fullPageScreenshots).catch((err) => { if (err && err.type && err.type === ‘RuntimeError’ && err.message && (err.message.indexOf(‘was terminated due to’) > -1 || err.message.indexOf(‘no such window: target window already closed’) > -1) ) { this.isRunning = false; } }); } }async _withinBegin(locator) { const frame = isFrameLocator(locator); const client = this.browser; if (frame) { if (Array.isArray(frame)) { withinStore.frame = frame.join(‘>’); return client .frame(null) .then(() => frame.reduce((p, frameLocator) => p.then(() => this.switchTo(frameLocator)), Promise.resolve())); } withinStore.frame = frame; return this.switchTo(frame); } withinStore.elFn = this.browser.element; withinStore.elsFn = this.browser.elements; this.context = locator;
}
async _withinEnd() { if (withinStore.frame) { withinStore = {}; return this.switchTo(null); } this.context = this.root; this.browser.element = withinStore.elFn; this.browser.elements = withinStore.elsFn; withinStore = {}; }
/**
*/ async _locate(locator, smartWait = false) { if (!this.options.smartWait || !smartWait) return this.browser.elements(withStrictLocator.call(this, locator)); this.debugSection(
SmartWait (${this.options.smartWait}ms)
,Locating ${locator} in ${this.options.smartWait}
);}
/**
*/ async _locateCheckable(locator) { return findCheckable.call(this, locator, this.browser.elements.bind(this)).then(res => res.value); }
/**
*/ async _locateClickable(locator) { return findClickable.call(this, locator, this.browser.elements.bind(this)).then(res => res.value); }
/**
*/ async _locateFields(locator) { return findFields.call(this, locator).then(res => res.value); }
/**
*/ async defineTimeout(timeouts) { if (timeouts.implicit) { await this.browser.timeouts(‘implicit’, timeouts.implicit); } if (timeouts[‘page load’]) { await this.browser.timeouts(‘page load’, timeouts[‘page load’]); } // both pageLoad and page load are accepted // see http://webdriver.io/api/protocol/timeouts.html if (timeouts.pageLoad) { await this.browser.timeouts(‘page load’, timeouts.pageLoad); } if (timeouts.script) { await this.browser.timeouts(‘script’, timeouts.script); } return this.browser; // return the last response }
/**
/**
}
/**
}
/**
}
/**
/**
/**
/**
}
/**
File at ${file} can not be found on local system
); } const el = await findFields.call(this, locator); this.debug(Uploading ${file}
);}
/**
}
/**
}
/**
}
/**
yield
operator.*/ async grabHTMLFrom(locator) { return this.browser.getHTML(withStrictLocator.call(this, locator)).then(html => html); }
/**
}
/**
*/ async grabCssPropertyFrom(locator, cssProperty) { const res = await this._locate(locator, true); assertElementExists(res, locator);
}
/**
/**
/**
*/ async seeTitleEquals(text) { const title = await this.browser.getTitle(); return assert.equal(title, text,
expected web page title to be ${text}, but found ${title}
); }/**
/**
/**
/**
*/ async seeTextEquals(text, context = null) { return proceedSee.call(this, ‘assert’, text, context, true); }
/**
/**
/**
/**
/**
/**
elements of ${locator}
, ‘to be seen’).assert(false); } const commands = []; res.value.forEach(el => commands.push(this.browser.elementIdDisplayed(el.ELEMENT))); const selected = await this.browser.unify(commands, { extractValue: true }); return truth(elements of ${locator}
, ‘to be seen’).assert(selected); }/**
elements of ${locator}
, ‘to be seen’).negate(false); } const commands = []; res.value.forEach(el => commands.push(this.browser.elementIdDisplayed(el.ELEMENT))); const selected = await this.browser.unify(commands, { extractValue: true }); return truth(elements of ${locator}
, ‘to be seen’).negate(selected); }/**
/**
/**
/**
/**
*/ async grabBrowserLogs() { return this.browser.log(‘browser’).then(res => res.value); }
/**
Current URL is [${url}]
);*/ async grabBrowserUrl() { const res = await this.browser.url(); return res.value; }
/**
/**
*/ async seeNumberOfElements(selector, num) { const res = await this._locate(withStrictLocator.call(this, selector)); return assert.equal(res.value.length, num,
expected number of elements (${selector}) is ${num}, but found ${res.value.length}
); }/**
*/ async seeNumberOfVisibleElements(locator, num) { const res = await this.grabNumberOfVisibleElements(locator); return assert.equal(res, num,
expected number of visible elements (${locator}) is ${num}, but found ${res}
); }/**
*/ async seeCssPropertiesOnElements(locator, cssProperties) { const res = await this._locate(locator); assertElementExists(res, locator); const elemAmount = res.value.length; const commands = []; res.value.forEach((el) => { Object.keys(cssProperties).forEach((prop) => { commands.push(this.browser.elementIdCssProperty(el.ELEMENT, prop)); }); }); let props = await this.browser.unify(commands, { extractValue: true }); const values = Object.keys(cssProperties).map(key => cssProperties[key]); if (!Array.isArray(props)) props = [props]; let chunked = chunkArray(props, values.length); chunked = chunked.filter((val) => { for (let i = 0; i < val.length; ++i) { if (val[i] !== values[i]) return false; } return true; }); return assert.ok( chunked.length === elemAmount,
Not all elements (${locator}) have CSS property ${JSON.stringify(cssProperties)}
, ); }/**
*/ async seeAttributesOnElements(locator, attributes) { const res = await this._locate(locator); assertElementExists(res, locator); const elemAmount = res.value.length; const commands = []; res.value.forEach((el) => { Object.keys(attributes).forEach((attr) => { commands.push(this.browser.elementIdAttribute(el.ELEMENT, attr)); }); }); let attrs = await this.browser.unify(commands, { extractValue: true }); const values = Object.keys(attributes).map(key => attributes[key]); if (!Array.isArray(attrs)) attrs = [attrs]; let chunked = chunkArray(attrs, values.length); chunked = chunked.filter((val) => { for (let i = 0; i < val.length; ++i) { if (val[i] !== values[i]) return false; } return true; }); return assert.ok( chunked.length === elemAmount,
Not all elements (${locator}) have attributes ${JSON.stringify(attributes)}
, ); }/**
*/ async grabNumberOfVisibleElements(locator) { const res = await this._locate(locator); assertElementExists(res, locator);
}
/**
/**
/**
/**
/**
/**
/**
*/ async scrollTo(locator, offsetX = 0, offsetY = 0) { if (typeof locator === ‘number’ && typeof offsetX === ‘number’) { offsetY = offsetX; offsetX = locator; locator = null; }
}
/**
}
/**
}
/**
/**
/**
cookie ${name}
, ‘to be set’).assert(res); }/**
cookie ${name}
, ‘to be set’).negate(res); }/**
/**
/**
/**
window.alert|window.confirm|window.prompt
, contains the/**
*/ async grabPopupText() { return this.browser.alertText() .catch(() => null); // Don’t throw an error }
/**
*/ async pressKey(key) { let modifier; const modifiers = [‘Control’, ‘Command’, ‘Shift’, ‘Alt’]; if (Array.isArray(key) && modifiers.indexOf(key[0]) > -1) { modifier = key[0]; } await this.browser.keys(key); if (!modifier) return true; return this.browser.keys(modifier); // release modifier }
/**
}
}
/**
*/ async dragAndDrop(srcElement, destElement) { const client = this.browser;
}
/**
*/ async closeOtherTabs() { const client = this.browser; const handles = await this.browser.getTabIds(); const mainHandle = handles[0]; let p = Promise.resolve(); handles.shift(); handles.forEach((handle) => { p = p.then(() => client.switchTab(handle).then(() => client.close(mainHandle))); }); return p; }
/**
/**
element (${locator}) still not enabled after ${aSec} sec
); }/**
element (${locator}) still not present on page after ${aSec} sec
); }/**
/**
*/ async waitInUrl(urlPart, sec = null) { const client = this.browser; const aSec = sec || this.options.waitForTimeout; let currUrl = ‘’; return client .waitUntil(function () { return this.url().then((res) => { currUrl = decodeUrl(res.value); return currUrl.indexOf(urlPart) > -1; }); }, aSec * 1000).catch((e) => { if (e.type === ‘WaitUntilTimeoutError’) { throw new Error(
expected url to include ${urlPart}, but found ${currUrl}
); } else { throw e; } }); }/**
*/ async waitUrlEquals(urlPart, sec = null) { const aSec = sec || this.options.waitForTimeout; const baseUrl = this.options.url; if (urlPart.indexOf(‘http’) < 0) { urlPart = baseUrl + urlPart; } let currUrl = ‘’; return this.browser.waitUntil(function () { return this.url().then((res) => { currUrl = decodeUrl(res.value); return currUrl === urlPart; }); }, aSec * 1000).catch((e) => { if (e.type === ‘WaitUntilTimeoutError’) { throw new Error(
expected url to be ${urlPart}, but found ${currUrl}
); } else { throw e; } }); }/**
element (${context}) is not in DOM or there is no element(${context}) with text "${text}" after ${aSec} sec
, ); }/**
Waits for the specified value to be in value attribute
I.waitForValue(‘//input’, “GoodValue”);
@param field input field
@param value expected value
@param sec seconds to wait, 1 sec by default */ async waitForValue(field, value, sec = null) { const client = this.browser; const aSec = sec || this.options.waitForTimeout; return client.waitUntil( async () => { const res = await findFields.call(this, field); if (!res.value || res.value.length === 0) return false; const commands = []; res.value.forEach(el => commands.push(this.browser.elementIdAttribute(el.ELEMENT, ‘value’)));
const selected = await this.browser.unify(commands, { extractValue: true }); if (Array.isArray(selected)) { return selected.filter(part => part.indexOf(value) >= 0).length > 0; } return selected.indexOf(value) >= 0; }, aSec * 1000,
element (${field}) is not in DOM or there is no element(${field}) with value "${value}" after ${aSec} sec
, ); }/**
{{> …/webapi/waitForVisible }}
Appium: support */ async waitForVisible(locator, sec = null) { const aSec = sec || this.options.waitForTimeout; return this.browser.waitUntil(async () => { const res = await this.browser.elements(withStrictLocator.call(this, locator)); if (!res.value || res.value.length === 0) return false; const commands = []; res.value.forEach(el => commands.push(this.browser.elementIdDisplayed(el.ELEMENT)));
const selected = await this.browser.unify(commands, { extractValue: true }); if (Array.isArray(selected)) { return selected.filter(val => val === true).length > 0; } return selected; }, aSec * 1000,
element (${locator}) still not visible after ${aSec} sec
); }/**
*/ async waitNumberOfVisibleElements(locator, num, sec = null) { const aSec = sec || this.options.waitForTimeout; return this.browser.waitUntil(async () => { const res = await this.browser.elements(withStrictLocator.call(this, locator)); if (!res.value || res.value.length === 0) return false; const commands = [];
}
/**
{{> …/webapi/waitForInvisible }}
Appium: support */ async waitForInvisible(locator, sec = null) { const aSec = sec || this.options.waitForTimeout; return this.browser.waitUntil(async () => { const res = await this.browser.elements(withStrictLocator.call(this, locator)); if (!res.value || res.value.length === 0) return false; const commands = []; res.value.forEach(el => commands.push(this.browser.elementIdDisplayed(el.ELEMENT)));
const selected = await this.browser.unify(commands, { extractValue: true }); if (Array.isArray(selected)) { return selected.filter(val => val === false).length > 0; } return !selected; }, aSec * 1000,
element (${locator}) still visible after ${aSec} sec
); }/**
/**
element (${locator}) still attached to the DOM after ${aSec} sec
); }/**
/**
/**
*/ async switchToNextTab(num = 1, sec = null) { const aSec = sec || this.options.waitForTimeout; const client = this.browser; return client .waitUntil(function () { return this.getTabIds().then(function (handles) { return this.getCurrentTabId().then(function (current) { if (handles.indexOf(current) + num + 1 <= handles.length) { return this.switchTab(handles[handles.indexOf(current) + num]); } return false; }); }); }, aSec * 1000,
There is no ability to switch to next tab with offset ${num}
); }/**
*/ async switchToPreviousTab(num = 1, sec = null) { const aSec = sec || this.options.waitForTimeout; const client = this.browser; return client .waitUntil(function () { return this.getTabIds().then(function (handles) { return this.getCurrentTabId().then(function (current) { if (handles.indexOf(current) - num > -1) return this.switchTab(handles[handles.indexOf(current) - num]); return false; }); }); }, aSec * 1000,
There is no ability to switch to previous tab with offset ${num}
); }/**
*/ async closeCurrentTab() { const client = this.browser; return client.close(); }
/**
*/ async openNewTab() { const client = this.browser; return client.newWindow(‘about:blank’); }
/**
/**
*/ scrollPageToTop() { const client = this.browser; return client.execute(() => { window.scrollTo(0, 0); }); }
/**
*/ scrollPageToBottom() { const client = this.browser; return client.execute(() => { const body = document.body; const html = document.documentElement; window.scrollTo(0, Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight, )); }); }
/**
/**
/**
async function proceedSee(assertType, text, context, strict = false) { let description; if (!context) { if (this.context === webRoot) { context = this.context; description = ‘web page’; } else { description =
current context ${this.context}
; context = ‘.//*’; } } else { description =element ${context}
; }const smartWaitEnabled = assertType === ‘assert’;
const res = await this._locate(withStrictLocator.call(this, context), smartWaitEnabled); if (!res.value || res.value.length === 0) throw new ElementNotFound(context);
const commands = []; res.value.forEach(el => commands.push(this.browser.elementIdText(el.ELEMENT)));
const selected = await this.browser.unify(commands, { extractValue: true });
if (strict) return equals(description)[assertType](text, selected); return stringIncludes(description)[assertType](text, selected); }
async function findClickable(locator, locateFn) { locator = new Locator(locator); if (!locator.isFuzzy()) return locateFn(locator.simplify(), true); if (locator.isAccessibilityId()) return locateFn(withAccessiblitiyLocator.call(this, locator.value), true);
let els; const literal = xpathLocator.literal(locator.value);
els = await locateFn(Locator.clickable.narrow(literal)); if (els.value.length) return els;
els = await locateFn(Locator.clickable.wide(literal)); if (els.value.length) return els;
els = await locateFn(Locator.clickable.self(literal)); if (els.value.length) return els;
return locateFn(locator.value); // by css or xpath }
async function findFields(locator) { locator = new Locator(locator); if (!locator.isFuzzy()) return this._locate(locator.simplify(), true); if (locator.isAccessibilityId()) return this._locate(withAccessiblitiyLocator.call(this, locator.value), true);
const literal = xpathLocator.literal(locator.value); let els = await this._locate(Locator.field.byText(literal)); if (els.value.length) return els;
els = await this._locate(Locator.field.byName(literal)); if (els.value.length) return els; return this._locate(locator.value); // by css or xpath }
async function proceedSeeField(assertType, field, value) { const res = await findFields.call(this, field); assertElementExists(res, field, ‘Field’);
const proceedMultiple = (fields) => { let commands = []; fields.forEach(el => commands.push(this.browser.elementIdSelected(el.ELEMENT))); this.browser.unify(commands).then(() => { commands = []; fields.forEach((el) => { if (el.value === false) return; commands.push(this.browser.elementIdAttribute(el.ELEMENT, ‘value’)); }); return this.browser.unify(commands, { extractValue: true, }).then(val => stringIncludes(
fields by ${field}
)[assertType](value, val)); }); };const proceedSingle = el => this.browser.elementIdAttribute(el.ELEMENT, ‘value’).then(res => stringIncludes(
fields by ${field}
)[assertType](value, res.value));const tag = await this.browser.elementIdName(res.value[0].ELEMENT); if (tag.value === ‘select’) { return proceedMultiple(res.value); }
if (tag.value === ‘input’) { return this.browser.elementIdAttribute(res.value[0].ELEMENT, ‘type’).then((type) => { if (type.value === ‘checkbox’ || type.value === ‘radio’) { return proceedMultiple(res.value); } return proceedSingle(res.value[0]); }); } return proceedSingle(res.value[0]); }
async function proceedSeeCheckbox(assertType, field) { const res = await findFields.call(this, field); assertElementExists(res, field, ‘Field’);
const commands = []; res.value.forEach(el => commands.push(this.browser.elementIdSelected(el.ELEMENT))); const selected = await this.browser.unify(commands, { extractValue: true }); return truth(
checkable field ${field}
, ‘to be checked’)assertType; }async function findCheckable(locator, locateFn) { let els; locator = new Locator(locator); if (!locator.isFuzzy()) return locateFn(locator.simplify(), true); if (locator.isAccessibilityId()) return locateFn(withAccessiblitiyLocator.call(this, locator.value), true);
const literal = xpathLocator.literal(locator.value); els = await locateFn(Locator.checkable.byText(literal)); if (els.value.length) return els; els = await locateFn(Locator.checkable.byName(literal)); if (els.value.length) return els;
return locateFn(locator.value); // by css or xpath }
function withStrictLocator(locator) { locator = new Locator(locator); if (locator.isAccessibilityId()) return withAccessiblitiyLocator.call(this, locator.value); return locator.simplify(); }
function isFrameLocator(locator) { locator = new Locator(locator); if (locator.isFrame()) return locator.value; return false; }
function withAccessiblitiyLocator(locator) { if (this.isWeb === false) { return
accessibility id:${locator.slice(1)}
; } return[aria-label="${locator.slice(1)}"]
; // hook before webdriverio supports native ~ locators in web }function assertElementExists(res, locator, prefix, suffix) { if (!res.value || res.value.length === 0) { throw new ElementNotFound(locator, prefix, suffix); } }
function prepareLocateFn(context) { if (!context) return this._locate.bind(this); let el; return (l) => { if (el) return this.browser.elementIdElements(el, l); return this._locate(context, true).then((res) => { assertElementExists(res, context, ‘Context element’); return this.browser.elementIdElements(el = res.value[0].ELEMENT, l); }); }; }
module.exports = WebDriverIO;
@reubenmiller : I followed the Debug option 1,after that again it got failed for me…then I opt Debug option 2 and guess what again it got failed.
After that it just clicked in my mind to download the latest Chromedriver and this time it worked for me,so basically I was having old version of Chromedriver .
Strange thing is that on my client server I am using the latest ChromeDriver i.e. 2.33 and few days back I was got this error for 2 to 3 days continuously and since yesterday its not coming,so as off now changing the chromedriver worked for me on my local machine.
I will let you know if this fails on my server with this latest chromedriver again.
Thanks for this great help and Yes this change of WebdriverIO also worked I think 😃