所以我在c#winform中使用selenium firefox webdrivers,我在下面有这个代码来获取当你点击"webtraffic_popup_start_button"时显示的弹出窗口的句柄,它应该得到弹出窗口的句柄,但弹出句柄是相同的作为现在的.
string current = driver.CurrentWindowHandle;
driver.FindElement(By.XPath("//*[@id='webtraffic_popup_start_button']")).Click();
Thread.Sleep(Sleep_Seconds);
popup = driver.CurrentWindowHandle;
Thread.Sleep(3000);
driver.SwitchTo().Window(current);
Thread.Sleep(1000);
Run Code Online (Sandbox Code Playgroud)
任何帮助都将非常感谢谢谢
这就是弹出式的样子.
尝试在类中使用print函数来打印声明的变量.
class MovieData{
private:
int year, runtime;
string title, director;
public:
MovieData(string t, string d, int y, int rt){
year = y;
runtime = rt;
title = t;
director = d;
}
print{
cout << title << " (" << year << "). Directed by " << director << ". (" << rt << " minutes)";
}
};
Run Code Online (Sandbox Code Playgroud)
错误出现了:
main.cpp:20:9: error: ‘print’ does not name a type
print{
^
main.cpp: In function ‘void doIt(std::string, std::string, int, int)’:
main.cpp:33:5: error: ‘class …Run Code Online (Sandbox Code Playgroud)