Search code examples
javascripttypescriptseleniumselenium-chromedriverwebdriver-io

[WebdriverIO][Typescript] Is it possible to get a custom variable from the browser window?


Hi lets assume i have a custom variable in the browser."Custom variable" Is it possible to get it with webdriverIO with the browser.execute() method?


Solution

  • Yes, it's possible with js.

    browser.execute("return a")
    

    Here is the sample I tried in python using js which is equivalent to browser.execute. enter image description here