![](/img/trans.png)
[英]How can I switch to the new open page after click button register? C# Selenium specflow
[英]Cannot Switch to new browser Window after click button C# Selenium
单击按钮打开新的浏览器窗口时,我遇到了情况。 我尝试以这种方式切换到新窗口:
driver.SwitchTo().Window(driver.WindowHandles.Last());
但这行不通。 有错误
'System.Collections.ObjectModel.ReadOnlyCollection'不包含'Last'的定义,并且找不到扩展方法'Last'接受类型为'System.Collections.ObjectModel.ReadOnlyCollection'的第一个参数(是否缺少using指令或装配参考?)
我该怎么办?
尝试在下面使用:
driver.SwitchTo().Window(driver.WindowHandles.ToList().Last());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.