Can Selenium web driver have access to javascript global variables?

前端 未结 1 1298
暖寄归人
暖寄归人 2020-12-09 19:08

Hi: I\'m writing tests for django with javascript and I was wondering if the Selenium webdriver can access a javascript global variable. mypage has a script tha

相关标签:
1条回答
  • 2020-12-09 19:26

    Yes, you should be able to that with code similar to the below:

    browser.execute_script("return globalVar;")
    
    0 讨论(0)
提交回复
热议问题