1. Dismiss Notice
  2. Dismiss Notice

Errors in the templates?! Find and solve them 2 times faster !!!

Discussion in 'Useful articles' started by LightWood, Mar 23, 2017.

  1. LightWood

    LightWood Moderator

    Joined:
    Nov 4, 2010
    Messages:
    2,160
    Likes Received:
    747
    A competently asked question, this is half the answer.
    And in a ZennoPoster well-structured error log, this is half the solution.


    On this simple example, which you can easily use, in your templates, I will demonstrate this.
    You won't regret if you understand!

    First, you need to learn that every step in the template has a unique ID, by which it can be identified and found in ProjectMaker.

    In order to get the step id with an error, it is necessary in the ZennoPoster logs, right click on the error and click "copy id".
    q1.png

    Next, in ProjectMaker, click on the search, insert ID and find the step, and already understand why all this is so.
    q2-1.png

    But until you copy the id and find it in ProjectMaker, it's unclear where the error occurred, it's also unclear how many such errors, and how many others. To engage in a depressing copy-paste from the logs, this is a solution for freaks. I hope you are not that, my reader. Tasks need to be solved elegantly and simply)

    I offer you the following solution:
    q3-1.png
    As you can see, the screen uses a big red circle badEnd.
    But he does't have a single input arrow. Because the template itself automatically runs execution to badEnd if an error occurred during execution.

    To catch a bug and that it was visually displayed I do the following:
    1. Get tickCount, this is a unique value of numbers. This is so that the elements and logs that we get below are merged for each thread, but also unique, so that the file names do not coincide with the names that the other threads will save.
    2. Get the error ID inside the template
    q4.png
    Much and all the basics are available in ZP without the knowledge of programming languages, but in some situations, they can't be dispensed with. Just use this code to get the step ID in which the error is.
    3. Using CaptchaSaver, we will make an instance screen. It works like a captcha detection module, only we indicate the tag we want to save like image, in our case the entire visible part is the BODY tag (Who does not know why BODY, learn the basics of html.) The BODY tag have entire visible part of the page)
    q5-1.png
    And in the "additional" tab, we specify the path and name of the received screenshot to save the screenshot. In our case this is:
    {-Project.Directory-}error \{- Variable.Log_Error -}-{- Variable.tickID -}.jpg
    Project directory\error\received in step2-unique tick ID.jpg

    q6-1.png
    4. Save the source code of page.
    5. Save the DOM of page.
    6. This C# code gets the name and value of all the variables used in the template.
    7. Save all these variables to a file.
    q7.png

    As a result, your logs will look like this:
    q8.png
    ga-2225 is an example of error id, you can have many and different ones, but using to tickCount various files of the same error will be grouped!

    And using to the screenshot you will visually see the error, and thanks to the source code and DOM of the page, you will know in what state the page code was at the time of the error.

    Edit errors will be easy and simple!

    To use the template, just copy this column with the steps to your project and connect it to BadEnd.
    And you will understand how obvious and understandable are the mistakes!
     

    Attached Files:

    Last edited: Mar 23, 2017
    adminx, zenfreak, sMax and 1 other person like this.
  2. krisztos

    krisztos Client

    Joined:
    Jun 28, 2014
    Messages:
    132
    Likes Received:
    4
    Very nice tutorial, the only thing I wonder how to easily locate that "error id" in project maker - which block it is.
     
  3. sMax

    sMax Client

    Joined:
    May 4, 2011
    Messages:
    131
    Likes Received:
    47
    Great share.

    The partial name of the files up to the 2 dashes is the Action Id. It is also in the variables file as "Name: Log_Error Value:" , easy as pie.
    Just click on the "magnifying glass" in the advanced editor, paste the Action Id in it, press enter and it takes you to the block.

    To quote the OP:
    Great share!

    PS. what the op calls the Error Id is actually the Action Id (of the block)
     
    Last edited: Mar 23, 2017
    LightWood likes this.
  4. LightWood

    LightWood Moderator

    Joined:
    Nov 4, 2010
    Messages:
    2,160
    Likes Received:
    747
    Thanks. Good answer.
     
  5. NICOLAS Christophe

    NICOLAS Christophe Client

    Joined:
    Jul 10, 2017
    Messages:
    5
    Likes Received:
    0
    Nice share. Thanks for that.
     
  6. LightWood

    LightWood Moderator

    Joined:
    Nov 4, 2010
    Messages:
    2,160
    Likes Received:
    747
  7. adminx

    adminx Новичок

    Joined:
    Mar 24, 2018
    Messages:
    15
    Likes Received:
    1
    thank
     
    LightWood likes this.
  8. spyder

    spyder Новичок

    Joined:
    Oct 19, 2014
    Messages:
    22
    Likes Received:
    1
    it is helpful. thank you
     
    LightWood likes this.
  9. LightWood

    LightWood Moderator

    Joined:
    Nov 4, 2010
    Messages:
    2,160
    Likes Received:
    747

Пользователи просматривающие тему (Пользователей: 0, Гостей: 0)