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

4 posts, 0 answers
  1. joe
    joe avatar
    5 posts
    Member since:
    Jan 2011

    Posted 03 Feb 2011 Link to this post

    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();

  2. Nikolai
    Admin
    Nikolai avatar
    112 posts

    Posted 07 Feb 2011 Link to this post

    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
  3. joe
    joe avatar
    5 posts
    Member since:
    Jan 2011

    Posted 07 Feb 2011 Link to this post

    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();

  4. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 08 Feb 2011 Link to this post

    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
Back to Top