Forum Discussion

CrTosS's avatar
CrTosS
New Contributor
14 years ago

Fatal Error detection by TC

Can anyone help on this one? I am a new learner to TC.



Suppose I want to test 100 links in a PHP built website. Task is easy that only to find out whether the page is loading correctly. I found out by the script I wrote, it is not able to detect the page loading error such as



FATAL [/****/config.php:12] Constant BASE_DIR already defined




Please suggest any idea how to handle this. Thankkkks
  • AlexeyKryuchkov's avatar
    AlexeyKryuchkov
    SmartBear Alumni (Retired)
    Hi Rui,



    If you need to make sure that all links on a page are not broken, you can try using web accessibility checkpoints. For additional information, please refer to the Web Accessibility Checkpoints help topic and the related topics.
  • CrTosS's avatar
    CrTosS
    New Contributor
    Mike, thanks.



    I have studied the accessibility and I think the best way suit to my question is to add a title check. However,  it looks like in Stores, the object is created particular to one single page. But in my desire, I want the object to be dynamic created as current page.



    See my codes, it open excel and open the URL defined one by one. In the {} section, is it possible to add statements to define the current page as the object, so that WebTesting.WebAccessibility1.Check will work?









    Set objExcel = CreateObject("Excel.Application")

    Set objWorkbook1 = objExcel.workbooks.open ("E:\*.xls")



    Sub Unit1()



      Call Log.AppendFolder("Launching Internet Explorer")     



      Dim intRow

      intRow = 1



      Dim iexplore, URL, page

      Set iexplore = TestedApps.iexplore.Run()      

          

      Do Until intRow = 10

     

     

      'objExcel.Cells(intRow,1).Value = ""

     

      URL = objExcel.Cells(intRow,1).Value



     

     

      Call iexplore.WaitPage("*", 2500).ToURL(URL)

     

    {



     

     

     }

     

      intRow = intRow + 1





    Loop



      Call Log.PopLogFolder()  

      Call TestedApps.iexplore.Close()

     

    objWorkbook1.close

    objExcel.Quit

     

    End Sub
  • AlexeyKryuchkov's avatar
    AlexeyKryuchkov
    SmartBear Alumni (Retired)
    Hi Rui,



    However,  it looks like in Stores, the object is created particular to one single page.


    You can make web accessibility checkpoints more flexible using the Name Mapping feature. If the Map object names automatically option is enabled, TestComplete will create web accessibility checkpoints using the page's mapped name. If TestComplete uses a mapped name of a page, it means that this name is linked to the actual page by values of one or several properties (e.g. ObjectType and URL) or by other mapping criteria. When getting the actual object via its custom name, TestComplete performs a search by these criteria, and if they are flexible enough, you can get any of the pages you need.



    For example, if you have only one page open, and you need to perform a web accessibility check for it, you need to enable the mentioned option, create a web accessibility checkpoint for a page and modify the resulting page's mapping criteria, so the URL property will be equal to "*" (asterisk). To learn how to modify mapping criteria, please refer to the Modifying Mapping Criteria help topic.



    I hope this information helps you.