以下代码行是使用Selenium IDE和Firefox记录的脚本的一部分。当我使用Selenium IDE播放脚本时,它可以很好地工作。
selenium.Open("/login.aspx");
selenium.Type("id=ctl00_Content_Login1_Password", "xxxxxxxx");
selenium.Type("id=ctl00_Content_Login1_UserName", "xxxxxxxxxxxx");
selenium.Click("id=ctl00_Content_Login1_LoginButton");
selenium.WaitForPageToLoad("30000");
selenium.Click("link=Time Clock Entry");
selenium.WaitForPageToLoad("30000");
selenium.Click("id=btnPunch");
selenium.WaitForPageToLoad("30000");
selenium.Click("id=ctl00_Content_lnkLogout");
selenium.WaitForPageToLoad("30000");
有没有办法让这个脚本在WinForm应用程序的webBrowser控件中运行?