Closed l-alladi closed 3 years ago
switchTo
doesn't seem to be accepting string to do an action...for a moment can you please try using a regex like
await switchTo(/ServiceNow – Google Chrome/)
yes, using regular expression helped. thanks @NivedhaSenthil
switchTo
only supports regular expressions now. This the documentation was updated a while ago to reflect this https://docs.taiko.dev/api/switchto/
My code looks like this: await button({id : 'lookup.incident.assignment_group'},{navigationTimeout:10000}).exists() await click(button({id : 'lookup.incident.assignment_group'},{navigationTimeout:10000}),{selectHiddenElements: true}) waitFor(10000) await switchTo('ServiceNow – Google Chrome')
after await click(button({id : 'lookup.incident.assignment_group'},{navigationTimeout:10000}),{selectHiddenElements: true}) new window(not tab) opens with tittle 'ServiceNow – Google Chrome'
Taiko not able to switch to this window and select text, displays below error:
Error Message: Error: No tab(s) matching ServiceNow – Google Chrome found Stacktrace: Error: No tab(s) matching ServiceNow – Google Chrome found at module.exports.switchTo (node_modules\taiko\lib\taiko.js:425:13) at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async module.exports. (node_modules\taiko\lib\taiko.js:3266:14)
at async Object. (tests\incident.js:892:3)