System.Windows.Forms reference is not recognized

3 posts, 0 answers
  1. Sherjo
    Sherjo avatar
    3 posts
    Member since:
    Dec 2012

    Posted 28 Jul Link to this post

    Hi,

    I have this code so that it can handle confirm dialogs:
    Manager.DialogMonitor.AddDialog(AlertDialog.CreateAlertDialog(ActiveBrowser, DialogButton.OK));
    Manager.DialogMonitor.Start();

    But I got this error:

    (CS0103) The name 'AlertDialog' does not exist in the current context
    (CS0103) The name 'DialogButton' does not exist in the current

    I added the System.Windows.Forms reference (following the instructions from this link):
    http://docs.telerik.com/teststudio/features/coded-steps/add-assembly-reference

    I also added this on top of the code behind file:
    using System.Windows.Forms;

    After adding the reference and the using statement, I still get the error message

    Question:
    1. What .dll should I use? I found 3 files with the same name(System.Windows.Forms.dll) but in different locations, I tried to reference them one by one but still the same error message appears
    a. C:\Windows\Microsoft.NET\Framework64\v4.0.30319
    b. C:\Windows\Microsoft.NET\Framework\v4.0.30319
    c. C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089

    2. Is there something that I am missing? how could I make this work?

    Thanks!

  2. Sherjo
    Sherjo avatar
    3 posts
    Member since:
    Dec 2012

    Posted 02 Aug Link to this post

    Hi,

    I already solved this.

    instead of adding "using System.Windows.Forms;" I added "using ArtOfTest.WebAii.Win32.Dialogs;"

    after that, ConfirmDialog was recognized.

    thanks.

  3. Boyan Boev
    Admin
    Boyan Boev avatar
    1040 posts

    Posted 02 Aug Link to this post

    Hello Sherjo,

    Happy to hear that. Yes the dialogs namespace is ArtOfTest.WebAii.Win32.Dialogs as you have already determine.

    If yo need further assistance please let us know.

    Regards,
    Boyan Boev
    Telerik by Progress
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top