English 中文(简体)
Problems with Error: There was an unexpected Confirmation!
原标题:

I am trying to delete a user from a table. At first I was getting a timeout error but used the BeatnicClick() as described here:

Selenium IDE click() timeout

That solved the timeout error but I m still getting the unexpected confirmation error. Here s part of the source code:

selenium.Click("ctl00_btnAddressBook"); selenium.WaitForPageToLoad("30000");

// selenium.BeatnicClick("ctl00_page_content_ExistingEmployees_ctl03_btnDeleteEmployee");

String Are you sure you want to delete the selected item? = selenium.GetConfirmation();

Any help would be appreciated. Thanks in advance.

问题回答

To handle the confirmation your code should look like

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?"));

This should click on the delete element and then get the confirm and if you want it can assert its the correct message





相关问题
Sybase Development IDE

Is there a Toad type application for Sybase? I can t seem to find a single one! I ve tried using VS 2008 but can t see the sproc source.

Good C IDE for Mac? [closed]

I ve just started a job where I m programming in C on a Mac, which is my first experience using a Mac for development. For now I m using Xcode as my editor, then using make/gcc/svn at the command line ...

What are your experiences with Code::Blocks? [closed]

I looked at Code::Blocks and it certainly looks great for c++ development, I like it s multiplatform capabilities (runs everywhere), but I wanted to get your feedback. Is it good/stable enough to be ...

What do you use to write Go [closed]

I know its a bit too early, but I ve been trying out Go (Google s Programming Language) and its kindof annoying to write code in gedit. So, my question: What do you use to experiment with Go?

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

Eclipse smart quotes - like in Textmate

Happy Friday — Does anyone know if eclipse has the notion of smart quotes like Textmate. The way it works is to select some words and quote them by simply hitting the " key? I m a newbie here so be ...

Selenium IDE: Incrementing values by 1 and 71

Currently I m incrementing a value called wert by 1 with the following code: getEval storedVars[ wert ]=${wert}+1; The value wert is something like 80401299. I want to add 1 to the value, if it ...

热门标签