Forum Discussion

AMR013's avatar
AMR013
Contributor
2 years ago

Opening web browser then accessing URL not consistently working

Hello,   I'm having issues with opening a browser, then accessing a URL consistently. When I first run my lines, it works fine (Browser is opened, and URL is inputted/accessed). When I try to re-ru...
  • eykxas's avatar
    2 years ago

    Hi ! 

     

    you can try this : 
    Browsers.Item(btChrome).RunOptions = "url";
    Browsers.Item(btChrome).Run();

     

    instead of opening the browser then navigating to the webpage, TC opens the browser directly with the webpage.

  • rraghvani's avatar
    2 years ago

    Both codes work fine using JavaScript, using the latest version of TC and Chrome

        Browsers.Item(btChrome).RunOptions = "https://smartbear.com/";
        Browsers.Item(btChrome).Run();
        
        // Define URL
        var testURL = "https://smartbear.com/";
    
        // Launch browser and access testURL
        Browsers.Item(btChrome).Run(testURL);