Facing problem while clicking on submit button in Selenium RC

199 views
Skip to first unread message

venu

unread,
Sep 23, 2011, 8:44:30 AM9/23/11
to Selenium Users
Hi,

I am working on Selenium RC Scripts. I am automating a page which has
two buttons.

The first button HTML code is as follows

<input type="button" onclick="javascript:popupWindow('4','Display
Summary');" title="Open new summary pop up window" id="print_survey"
name="print_survey" value="Display Summary" class="button_strip
IE6trans">

And second button HTML code is

<input type="submit" name="Operation" value="SubmitButton"
id="saveresume" class="SaveResume_button save_resume IE6trans">

Now when i am on this page i am clicking on first button which open a
popup window, I am selecting the popup window, doing all my assertions
and closing the window by clicking the button on this popup window
which closes the popup window.

After closing of popup window i am again selecting the parent window.
Now when i try to click the second button it again opens the popup
window which is the functionality of first button.

Second button on the page is supposed to submit the form and takes the
control to thank you page, which is not happening through automation
scripts.

Waiting for some response from anyone so that i can resolve this issue
as soon as possible.

Thank you in advance .

Mike

unread,
Sep 23, 2011, 1:20:42 PM9/23/11
to Selenium Users
It would help to see the code you are using, or are you just using
scripts recorded through the IDE?

If the latter case, can you list what the script looks like?

Mike

venu reddy

unread,
Sep 26, 2011, 12:38:31 AM9/26/11
to seleniu...@googlegroups.com
Hi MIke,

Please find the below script which i am using to open the Popup window and for navigating to the main window.Also find the screen shot of the buttons.

$_SESSION['mainWindowTitle'] = $this->browser->getTitle();                        $this->browser->getEval("this.browserbot.getCurrentWindow().popupWindow('3', 'Display Summary')");
$this->selenium->waitForPopUp("", "30000");
$this->selenium->windowFocus("title=Data Collection");
$this->selenium->selectPopUp("title=Data Collection");
$this->selenium->click("//input[@id='close_window']");
$this->selenium->selectWindow("title=$_SESSION[mainWindowTitle]");
$this->selenium->click("//input[@id='saveresume' and @class='SaveResume_button save_resume  IE6trans']");


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.




--
Regards,
Venugopal.

screenshot.doc

venu reddy

unread,
Sep 28, 2011, 5:36:59 AM9/28/11
to seleniu...@googlegroups.com
Hi Mike,

Thanks for your help. I got the solution.

Solution is as follows.

1) After doing all assertions and verifications on the popup window
2) Close the popup window
3) Select the parent window
4) Refresh the parent window
5) Wait for page to load
6) Click on the Second button i.e., Submit Button.

But i have one more question, is JavaScript creating any problem. Please let me know.

--
Regards,
Venugopal.

On Mon, Sep 26, 2011 at 10:08 AM, venu reddy <gopal...@gmail.com> wrote:
Hi MIke,

Please find the below script which i am using to open the Popup window and for navigating to the main window.Also find the screen shot of the buttons.

$_SESSION['mainWindowTitle'] = $this->selenium->getTitle();                        $this->selenium->getEval("this.browserbot.getCurrentWindow().popupWindow('3', 'Display Summary')");

Ujjal Goswami

unread,
Sep 28, 2011, 5:39:39 AM9/28/11
to seleniu...@googlegroups.com
hi,
    trying using selenium.windowFocus() method before clicking on the Submit button.May be the focus is not there on the 2nd button

THanks
Ujjal

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


Reply all
Reply to author
Forward
0 new messages