robotframework / OldSeleniumLibrary

Deprecated Selenium library for Robot Framework
Apache License 2.0
13 stars 3 forks source link

Confirmation window selection problem #55

Closed spooning closed 9 years ago

spooning commented 9 years ago

Originally submitted to Google Code by roopa.machaiah on 13 Oct 2009

I am automating our web application using SeleniumLibrary (version 2.2.1)

My test case is : step #1 : click on the delete button in my application (a confirmation window that loads as an applet comes up)

Step #2: Confirm by clicking on “delete” in the confirmation box that comes up in the applet.

Selenium is giving me a timed out message after the first delete click and fails to locate the confirmation window that is loaded

I have tried all possible keywords but none of it seems to be working.

Kindly help.

I have attached the snapshot and the source page file of my application.

The source page of my application for this bit is as follows:

</tr>

        &lt;/table&gt;

        &lt;br&gt;&lt;br&gt;&lt;br&gt;

        &lt;input type="submit" id="Modify"

name="action:ModifySingleSubscriptionAction!modify" value="Modify" class="button"/>

        &lt;input type="button" id="Delete" name="Delete" class="button"

value="Delete"

onclick="javascript:SAAMMessageBox.confirmAndDelete('Are you sure you want to delete this subscription?', this.form)" />

        &lt;/body&gt;

</form>

</td>

</tr>

spooning commented 9 years ago

Originally submitted to Google Code by @yanne on 19 Oct 2009

To be able to investigate this, I would have to know the implementation of SAAMMessageBox. Without this knowledge I cannot know how to access the dialog.

spooning commented 9 years ago

Originally submitted to Google Code by Magnus.Smedberg on 27 Oct 2009

Hi, I have similar problems. When running the attached test under Linux, "Confirm Action" seems to fail (or never execute), because the previous keyword (Click Link) times out. (See attached log file of the execution of one test case) However, when I leave the browser open after execution and check the page I've been testing, I can see that it's in the state after the pop up confirm, so maybe Confirm Action is being executed, but not registered as done?

If I set the Selenium speed to 2 seconds, it works some of the time, but not all.

For some reason, these test cases work fine when run in Windows (Firefox browser used in both win and linux), but as I said, not in Linux (Ubuntu). Same versions of Python, Selenium and RF on both systems.

Using SeleniumLib 2.2.1 btw.

BRs Magnus

spooning commented 9 years ago

Originally submitted to Google Code by @yanne on 28 Oct 2009

Have you tried executing the previous action (Click Link ${SEARCH VOUCHER ORDERS BUTTON SEARCH ORDERS} without waiting for a page load? Click link timeouts if reload does not happen (Although, then I wonder why it passes in Windows...)

spooning commented 9 years ago

Originally submitted to Google Code by Magnus.Smedberg on 28 Oct 2009

Hadn't actually tried it previously, no. Have now though... I can get it to work (on both Win & Linux) if I add "dont_wait" to that Click Link, but then I have to add an additional "wait" afterward so that it doesn't try to validate the response before the search is complete. As a workaround, it works, but it's quite ugly (first don't wait, then wait...).

spooning commented 9 years ago

Originally submitted to Google Code by @yanne on 25 Nov 2009

Fundamentally, the ugliness arises from the way Selenium tests and Javascript work. There's not much we can do, because we need to support the same user interactions (click link etc.) with both page loads happening and not.