Forum Discussion

suwingben's avatar
suwingben
Contributor
13 years ago

Closing IE or Omitting Warnings from Logs

At the end of my scripts, I like to have them close IE on their own , since they open IE at the beginning.



Is there a blanket way to do this? I've recorded the close, but some script's don't recognize the object sometimes.



If there isn't a blanket way to do it, is there a way to omit the warning messages about a browser being open in my logs? Since I'm doing keyword tests, I don't know how to implement the script that's listed in the help center to remove certain messages from a log.

4 Replies

  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Suwing,


    Is there a blanket way to do this?


    I think, there are several ways to do this, but I'd recommend that you add Internet Explorer to the Tested Applications collection, and then you can easily launch and close it using the TestedApp.Run and TestedApp.Close methods respectively.


    is there a way to omit the warning messages about a browser being open in my logs?


    As far as I know, TestComplete doesn't provide such functionality. However, you can filter the messages shown in the test log and make TestComplete not show the posted warnings. For this purpose, switch to the test log and clear the Warning check box on the test log toolbar.


    I hope this helps :)

  • Thanks so much!



    I was thinking about this again, and I realized that there had to have been a 'Close tested app' since there was an 'Open tested app' . Now I know where to look.



    Thanks again!
  • egbea's avatar
    egbea
    Occasional Contributor
    I am a novice in web services and I am trying to write script in TestComplete to read mail from mail web server.  I am at lost at what to do and I will appreciate any help I can get. Below is my code I have so far, and not able to access the Mail  Web Server. When I used bugger to look at what is going on, I see an error that says "Could not convert  varient of type(olestr) into type (Dispatch) " and the Logfile is all garbage.

    Please the attached file

    Thanks for your help.



    Function ReceiveEMail()



       Dim objXmlHttp

       Dim oXmlHttp

       Dim xmlDOMParams

       Dim xmlDOMParamsAttachement

       Dim xmlNdLstDonation, xmlNdLstDonation1

       Dim PropstatNodes,xmlGetEmailSubject

       Dim HrefNodes,XMLBody,XMLResponse

       Dim StatusNode,NewerVersion

       Dim str, RdHeader

       Dim browserVersion

       Dim NewerbVersion, OlderbVersion



       '****Client Access Server *****

       Const strUrl = "https://mail.sciemetric.com/exchange/ts/inbox" 'URL to CAS     

       Const strUser = "sciemetric\Bob001" 'Domain and Username to authenticate with

       Const strPassword = ""myExchangeUSeRsP4ssw0rd"

      ' Const strEmailAddress = "" 'Mailbox that you want to read data from

       NewerbVersion = "HigherVersion"

       OlderbVersion   = "LowerVersion"  

       Delay(2000)

       'Get Browers type and version

       browserVersion =  GetBrowsers()

       intCompare = StrComp(browserVersion, NewerbVersion, vbTextCompare)

       if intCompare = 0 Then

          'code for IE7+, Firefox, Chrome, Opera, Safari

          'xmlhttp=new XMLHttpRequest();

          Set objXmlHttp = CreateObject("MSXML2.XMLHTTP")   

       else

       'Create An XMLHTTP Object for for IE6, IE5

       'objXmlHttp =new ActiveXObject("Microsoft.XMLHTTP")

        objXmlHttp = CreateObject("Microsoft.XMLHTTP")

       End if

     

        ' MSXML2.ServerXMLHTTP40

        Set xmlDOMParams = Sys.OleObject("Msxml2.DOMDocument.4.0")

        ' Set objXmlDoc = CreateObject("MSXML2.DOMDocument.6.0") 'this will parse the response for us    



        ''****Open and read all the mails of inbox*************'

        '*.open("PROPFIND", ConnectingURL, False, UserName, PWD)

        '*.open("DELETE", strurl, False, UserName, PWD)

        '*.open("GET", strattachmentUrl, False, UserName, PWD)

        '*.open("X-MS-ENUMATTS", strUrl, False, UserName, PWD)

        '*******************************************************'

        Delay(2000)               

       ' objXmlHttp.open "GET",strUrl,False,strUser,strPassword

        objXmlHttp.open "GET",strUrl,False,strUser,strPassword  

        'objXmlHttp.setRequestHeader "Depth","1"

        objXmlHttp.setRequestHeader "Content-Type","xml"

        objXmlHttp.setRequestHeader "Depth","1"  

        objXmlHttp.send()

        While objXmlHttp.readyState <> 4

          objXmlHttp.waitForResponse 1000

        Wend

       ' if ((objXmlHttp.status = 200) Or (objXmlHttp.status = 0)) Then

          XMLBody = objXmlHttp.responseBody

          Log.Message(objXmlHttp.responseBody)

          Delay(2000)   

          Set XMLResponse =  objXmlHttp.responseXML

          Debug.Write(objXmlHttp.responseXML)

          'Get the Attachment

          str = objXmlHttp.responseText

          Log.Message(str)

          'Load the read mails into XML document'''

          xmlDOMParams.LoadXml(str)

          set xmlNdLstDonation1 = xmlDOMParams.GetElementsByTagName("a:href")

          Log.Message( xmlNdLstDonation1.Item(0))

          RdHeader =  objXmlHttp.getResponseHeader("Content-Type")

          Log.Message("Email Header: " & RdHeader)

          '''Get the list of text descriptions of all the mails'''

          set xmlNdLstDonation = xmlDOMParams.GetElementsByTagName("e:textdescription")

          Log.Message(xmlNdLstDonation.Item(0))

          '''Get the List of Subjects of all the mails'''

          set xmlGetEmailSubject = xmlDOMParams.GetElementsByTagName("d:subject")

          Log.Message(xmlGetEmailSubject.Item(0))

          

       ' else

          

      '  End if

          'Reset Object to null to free up objects

       Set objXmlHttp = Nothing

       Set  xmlDOMParams = Nothing

    End Function
  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Egbe,


    I just wanted to clarify one moment:

    I see an error that says "Could not convert  varient of type(olestr) into type (Dispatch)"


    Can you also post here the number (or the code) of the line that causes this error message?


    Also, please create new threads for the new themes. It will help other users find answers to their questions faster.