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

I'd like to sett annotations but don't get it

3 Answers 41 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
joe
Top achievements
Rank 1
joe asked on 04 Feb 2011, 01:43 AM

don't know where to set annotations on - my best guess was not good enough
giving me 
Error 2 The name 'GetSettings' does not exist in the current context 

                                Settings mySettings = new Settings(BrowserType.InternetExplorer, @"c:\log\");
                                // Create the manager object

                                Manager myManager = new Manager(mySettings);

                                Settings settings = GetSettings();
                                settings.AnnotateExecution = true;
                                // Start the manager

                                myManager.Start();

3 Answers, 1 is accepted

Sort by
0
Nikolai
Telerik team
answered on 07 Feb 2011, 04:06 PM
Hi joe,

 Here is the correct code sample you need to start the annotation:

var settings = new Settings();
settings.AnnotateExecution = true;
settings.AnnotationMode = AnnotationMode.All;
settings.LogLocation = @"c:\temp\log";
 
var manager = new Manager(settings);
manager.Start();

Hope this helps.

Best wishes,
Nikolai
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
joe
Top achievements
Rank 1
answered on 08 Feb 2011, 01:18 AM
that did not work

this is the new code now

                                Settings mySettings = new Settings(BrowserType.InternetExplorer, @"c:\log\");
                                // Create the manager object
                                Manager myManager = new Manager(mySettings);
                                var settings = new Settings();
                                settings.AnnotateExecution = true;
                                settings.AnnotationMode = AnnotationMode.All;
                                settings.LogLocation = @"c:\temp\log";

                                var manager = new Manager(settings);
                                manager.Start();

                                // Start the manager
                                myManager.Start();
                                // Launch a new browser instance. [This will launch an IE instance given the setting above]
                                myManager.LaunchNewBrowser();
                                // Navigate to a certain web page
                                myManager.ActiveBrowser.NavigateTo(sbrowser);
                                // Perform your automation actions.
                                IList<Element> editfields = myManager.ActiveBrowser.Find.AllByTagName("input");
                                Element mybtn = myManager.ActiveBrowser.Find.ByName("q");
                                //myManager.ActiveBrowser.Actions.Click(mybtn);
                                myManager.ActiveBrowser.Actions.SetText(mybtn,"joe");

 

                                // Shut-down the manager and do all clean-up

                                myManager.Dispose();

0
Cody
Telerik team
answered on 09 Feb 2011, 12:10 AM
Hi joe,

You tried to create two different Manager objects with two different Settings objects. That's why it's not working as you expected. Try this instead:

Settings mySettings = new Settings(BrowserType.InternetExplorer, @"c:\log\");
mySettings.AnnotateExecution = true;
mySettings.AnnotationMode = AnnotationMode.All;
// Create the manager object
Manager myManager = new Manager(mySettings);
// Start the manager
myManager.Start();
// Launch a new browser instance. [This will launch an IE instance given the setting above]
myManager.LaunchNewBrowser();
// Navigate to a certain web page
myManager.ActiveBrowser.NavigateTo(sbrowser);
// Perform your automation actions.
IList<Element> editfields = myManager.ActiveBrowser.Find.AllByTagName("input");
Element mybtn = myManager.ActiveBrowser.Find.ByName("q");
//myManager.ActiveBrowser.Actions.Click(mybtn);
myManager.ActiveBrowser.Actions.SetText(mybtn, "joe");
 
// Shut-down the manager and do all clean-up
myManager.Dispose();

Regards,
Cody
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
Tags
General Discussions
Asked by
joe
Top achievements
Rank 1
Answers by
Nikolai
Telerik team
joe
Top achievements
Rank 1
Cody
Telerik team
Share this question
or