Replies: 1 comment
-
The WebdriverIO config file is not the place for that, I recommend define a different file for it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I need to define variables/properties in wdio.config.js, and in-turn need to access/read in spec file.
Is there any best way to do it?
I tried below approach
getting message like concerned variable/property is undefined"
Code in Config file:
exports.config = {
testURL1:'https://webdriver.io/'
const login = {
'ID': 'run1',
'Pass': 'pass',
'Url' : 'https://aaa.com',
};
}
Spec file code:
describe('tests',async()=>
{
{
console.log("Env custom Paramater1:", browser.options. testURL1) //not working, message like Env custom Paramater1: undefined
console.log("Env custom Paramater2:", browser.options.login) ///not working, message like Env custom Paramater2: undefined
})
})
Beta Was this translation helpful? Give feedback.
All reactions