Problem with (free) testing framework

2 posts, 0 answers
  1. G S S
    G S S avatar
    85 posts
    Member since:
    Mar 2008

    Posted 02 Jun 2011 Link to this post

    Hi,

    This question is regarding the free testing framework (API).

    I have the following code:

     

     

    Settings settings = new Settings(BrowserType.InternetExplorer, @"C:\log.txt");

     

     

     

     

     

     

    Manager manager = new Manager(settings);

     

     

     

     

    manager.Start();

     

    manager.LaunchNewBrowser();

     

     

     

    Browser b = manager.ActiveBrowser;

     

     

    b.NavigateTo(

     

    "http://www.google.com");

    However, it launches the browser but does not do anything thereafter. If I play with the code and modify it, I g et an exception stating wait condition timed out.

    How do I make this code work (so that it will navigate to google etc)?

    Thanks

     

  2. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 02 Jun 2011 Link to this post

    Hello Gurdeep,

    Try this code instead:

    // Initialize the settings you want used. 
    Settings mySettings = new Settings(BrowserType.InternetExplorer, @"c:\log\"); 
        
    // 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("http://www.google.com"); 
        
    // Perform your automation actions. 
    Element mybtn = myManager.ActiveBrowser.Find.ByTagIndex("input", 3); 
    myManager.ActiveBrowser.Actions.Click(mybtn); 
        
    // Shut-down the manager and do all clean-up 
    myManager.Dispose();

    You can find more information in our online user's guide to Getting Started with Telerik Testing Framework.

    Best wishes,
    Anthony
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Back to Top