This is a migrated thread and some comments may be shown as answers.

System.Windows.Forms reference is not recognized

2 Answers 366 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sherjo
Top achievements
Rank 1
Sherjo asked on 28 Jul 2016, 07:43 AM

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 Answers, 1 is accepted

Sort by
0
Sherjo
Top achievements
Rank 1
answered on 02 Aug 2016, 06:13 AM

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.

0
Boyan Boev
Telerik team
answered on 02 Aug 2016, 06:48 AM
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!
Tags
General Discussions
Asked by
Sherjo
Top achievements
Rank 1
Answers by
Sherjo
Top achievements
Rank 1
Boyan Boev
Telerik team
Share this question
or