使用Selenium WebDriver打开浏览器时,重复使用会话变量
当打开一个新的浏览器进行
Dim driver As IWebDriver
会话变量会丢失时,我考虑过将这些变量保存在XML文件中以在WebDriver浏览器中重新加载它们,但这似乎并不是最好的选择。有没有办法将这些会话变量传递给Visual Basic和Firefox驱动程序的新浏览器?
When opening a new browser doing
Dim driver As IWebDriver
the session variables are lost, I have thought about saving these variables in xml files to reload them in the webdriver browser, but it really doesn't seem like the best option. Is there a way to pass these session variables to the new browser in Visual Basic and Firefox Driver?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您使用配置配置A webdriver的实例
baked webdriver session 会话,并将持续直到 web driver的寿命是不可编辑的。
即使您能够提取 session 属性,例如会话ID , cookie , useragent 和其他会话属性已经启动的 webdriver 仍然您在启动新的 WebDriver 会话时无法通过它们。
When you configure an instance of a WebDriver using
the configuration gets baked into the webdriver session and will persist till the lifetime of the WebDriver being uneditable.
Even if you are able to extract the Session attributes e.g. Session ID, Cookies, UserAgent and other session attributes from the already initiated WebDriver still you won't be able to pass them while initiating a new WebDriver session.