Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ide 错误问题:出现意外确认!_Ide_Selenium_Selenium Ide_Confirmation - Fatal编程技术网

Ide 错误问题:出现意外确认!

Ide 错误问题:出现意外确认!,ide,selenium,selenium-ide,confirmation,Ide,Selenium,Selenium Ide,Confirmation,我正在尝试从表中删除用户。起初,我收到一个超时错误,但使用了BeatnicClick(),如下所述: 这解决了超时错误,但我仍然收到意外的确认错误。以下是部分源代码: selenium.点击(“ctl00_btnAddressBook”); selenium.WaitForPageToLoad(“30000”) //selenium.BeatnicClick(“ctl00页面内容现有员工ctl03 btnDeleteEmployee”) 字符串是否确实要删除 所选项目= selenium.Ge

我正在尝试从表中删除用户。起初,我收到一个超时错误,但使用了BeatnicClick(),如下所述:

这解决了超时错误,但我仍然收到意外的确认错误。以下是部分源代码:

selenium.点击(“ctl00_btnAddressBook”); selenium.WaitForPageToLoad(“30000”)

//selenium.BeatnicClick(“ctl00页面内容现有员工ctl03 btnDeleteEmployee”)

字符串是否确实要删除 所选项目= selenium.GetConfirmation()


任何帮助都将不胜感激。提前感谢。

要处理确认,您的代码应该是这样的

selenium.Click("ctl00_btnAddressBook"); 
selenium.WaitForPageToLoad("30000");
//the IDE code is to get around the IDE bug that it waits on click but it works in Se:RC
selenium.Click("ctl00_page_content_ExistingEmployees_ctl03_btnDeleteEmployee");
//handle the confirmation that appears after the click
string confirmMessage = selenium.GetConfirmation();
//Assert its the correct message
Assert.IsTrue(Regex.IsMatch(confirmMessage,"Are you sure you want to delete the selected item?"));

这应该单击delete元素,然后获得确认,如果您愿意,它可以声明正确的消息

我不理解您的问题。我以为你需要帮助。您需要RC或IDE方面的帮助吗?我最初使用IDE,但现在已切换到Selenium RC。我在另一个领域尝试了你的建议,但仍然收到错误消息。我在下面的答案中发布了代码(因为它不适合这里),如果您使用IDE,则需要在后续命令之前存储确认。如以下问题的答案所述: