Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6950691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:07:25+00:00 2026-05-27T14:07:25+00:00

I have an application that brings up a popup window when you click a

  • 0

I have an application that brings up a popup window when you click a link. I have a watin test that naviates to the page and clicks a link to open the popup. This is my current code:

 [Test]
 public void TestCommentBoxInput()
        {

                window.GoTo("mylocalurl");
                window.Link(Find.ById("popuplink.aspx")).Click();
                IE iepopup_1 = IE.AttachTo<IE>(Find.ByUrl("popuplinkurl.aspx"));
                iepopup_1.TextField(Find.ById("txtComments")).TypeText("Commenttest");
         }

As you can see I tried attatching the popup window to the created browser called window. When I run my test it just stops at the popup window and never enters text in the box. How do I go about making my program regonize that it is now to be operating on the popup and not the original window?

EDIT: I am dealing with a Modal Dialog.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:07:26+00:00Added an answer on May 27, 2026 at 2:07 pm

    So I have figured out the problem, the problem was I was using a Modal dialog and they are handled differently. My new code is as follows in case anyone is stuck in the same position I was in. 🙂

    public void TestCommentBox()
            {
                window.GoTo("mylocalurl");
                window.Link(Find.ById("popuplink.aspx")).ClickNoWait();
                HtmlDialog dialog = window.HtmlDialog(Find.ByTitle("TestPopup"));
                dialog.TextField(Find.ById("Txtcomments")).TypeText("Commmenttest!");
            }
    

    The important lines are:

    window.Link(Find.ById("popuplink.aspx")).ClickNoWait();
    

    Notice that I am using ClickNoWait() and not just Click, I am unsure as to why this makes the difference, but it does! If someone could explain that that would be great.

    HtmlDialog dialog = window.HtmlDialog(Find.ByTitle("TestPopup"));
    

    Because I am dealing with a Modal dialog you have to declare a new HtmlDialog. Also in order to use Html dialog make sure you include Watin.Core.DialogHandlers. I hope this is helpful to someone out there! 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have application that brings response via Ajax and creates 5-20 new jQuery click
I have an iPad Split View Application that brings up a modal view to
I have an application that uses OAuth whose logic is something like this: If
Say I have a complex application that does various things, e.g. brings up a
I have application that makes different queries with different results so the caching in
I have application that is connecting to the DB and if I enter incorrect
I have application that is up more than 3 days. I can see in
I have an application that sends messages to an external web service. I build
I have an application that displays an image inside of a Windows Forms PictureBox
I have an application that reads a CSV file with piles of data rows.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.