Python Text Message Validation

Asked

Viewed 123 times

-2

Anyone has any idea how I do to validate a text message in Python, I have a screen that when I click to register and have some incorrect information it shows an error message informing the inconsistency...

For example:

There is a page that I fill with valid data to carry out a registration, when all the information is correct the registration is done correctly, however, when you have some field with incorrect information displays an error message printed on the screen as for example " invalid CNPJ" I’d like to know if I can validate that message, I’m using Python and Katalon to automate some tests.

Mensagem a ser validada

  • Your question is not clear; please ask the [tour] to understand how the community works, read the [Ask] guide to see how you can improve your question and, mainly, see how to elaborate a [mcve] to supplement your question.

  • ok.. I believe that now is clearer

  • "Speaking of test automation", now it’s even more confusing. What automation is this that you want to do?

  • I am automating a web page, and I need a routine that validates a text message ( as the image I sent ).

1 answer

0

You can do the following to render your form in the template:

{% for field in form %}
    {{ field.errors }}
    {{ field.label_tag }}
    {{ field }}
{% endfor %}

With this, the type of error above each field will be displayed, if the format is invalid or if it is a duplicated information for example in the case of a Create or Updateview...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.