Forum Discussion

svaze74's avatar
svaze74
Contributor
10 years ago

How do we start debugging of web appliaction using IE developer tools from within TestComplete

Hi,



Is there a way to run debugger of IE developer tools while simulating user actions on the AUT and capturing the errors and exceptions in test log.



This way, errors are exceptions are caught by default while execution of functional tests.



I know if script debugger setting for IE is enabled then IE itself throws error dialog while rendering the page.



But this dialog would then need to be handled separately.



What is required is capture the debug errors/exceptions silently in the background and still carry on the functional tests without being disturbed.



Any ideas?



Thanks,

Shrirang

4 Replies

  • jose_pita's avatar
    jose_pita
    Super Contributor
    Hi Shirirang,



    "Is there a way to run debugger of IE developer tools while simulating user actions on the AUT and capturing the errors and exceptions in test log."

    -For this you can use this piece of code to access the console and check its text, if this is what you need (I couldn't make the [CTRL+2] shortcut work)





    //opens the dev tools


      Sys.Browser("iexplore").Page("*").Keys("[F12]")


      //Sys.Browser("iexplore").Page("*").Keys("[Hold]^2")->couldn't make this work


      Sys.Browser("iexplore").BrowserWindow(0).Window("Frame Tab", "", 1).Window("F13FrameWindow", "F12", 1).Window("F12BrowserToolWindow", "", 1).Window("Shell Embedding", "", 1).Window("Shell DocObject View", "", 1).Window("Internet Explorer_Server", "", 1).Page("res://C:\\Program Files\\Internet Explorer\\F12Resources.dll/23/header/header.html").Nav("tabContainer").Panel("tabListContainer").TextNode(1).Click()


      //check the output text of the console


      Sys.Browser("iexplore").BrowserWindow(0).Window("Frame Tab", "", 1).Window("F13FrameWindow", "F12", 1).Window("WTL_SplitterWindow", "", 1).Window("F12BrowserToolWindow", "", 1).Window("Shell Embedding", "", 1).Window("Shell DocObject View", "", 1).Window("Internet Explorer_Server", "", 1).Page("res://C:\\Program Files\\Internet Explorer\\F12Resources.dll/23/console/console.html").Panel("mainContainer").Panel("outputArea").Panel("outputList").contentText






    After this you just need to analyse the output of the console whenever you want








  • Thanks Jose for the idea.



    I was thinking of using API of IE developer tools if that is supported or any workaround to use from built-in .Net functions.



    If that works then probably all functions of IE developer tools can be used like Response times, profiler tools etc which would be even more handy :-)











  • jose_pita's avatar
    jose_pita
    Super Contributor
    Well, if you can make it work with the API please put here the code so that I can check it :D
  • Yes I will if that gets through.



    I just wanted to check with community first that if someone already tried their hands with this :-)



    You know why to re-invent the wheel in first place :)