如何使用“发送键”或在新打开的浏览器窗口中查找新元素并返回到旧窗口?
这是我到目前为止的代码:
DesiredCapabilities EQcapabilities = new DesiredCapabilities();
EQcapabilities.SetCapability("appTopLevelWindow", EQWindowHandle);
var EQSession = new WindowsDriver<WindowsElement>(
new Uri("http://127.0.0.1:4723"), EQcapabilities);
// new window:
EQSession.FindElementByName("...").Click();
// I have tried this, but it is not working
String newWindowHandle = EQSession.WindowHandles.Last();
var newWindow = EQSession.SwitchTo().Window(newWindowHandle);
newWindow.sendkeys("some text");