Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
616 views
by Contributing Tester (51 points)
edited by

I have an application and that have form filling. There are different fields like the first name, last name, birthday and so on. And every field have validation (Can not be kept as blank ) if we are trying to submit the form keeping blank any of the field then will get validation popup "Please field out this field"
So my test scenario is to check validation for every field available in the form.

Note: I am unable to inspect the element from that validation popup("Please field out this field")

How can I achieve it in Automation?

3 Answers

1 like 0 dislike
by Contributing Tester (66 points)
After submitting the form immediately take the screenshot and then extract only texts from that screenshot and check whether the expected validation text contains in the extracted texts.

But my preference is to get the locator of the validation message and then compare with the expected message.

Hope this will helps you.
by Master (1.2k points)
good idea ...
0 like 0 dislike
by Contributing Tester (99 points)
if the validation popup is generated using JavaScript as an HTML element below the filed, you should be able to inspect it. If it is rendered on the browser, there is no way you can not inspect it.

Try to reproduce the error message, right click and click inspect and let us know how it work.

 

Also, I will appriciate if you can edit your question and post screenshot of your app and inspection window.
by Contributing Tester (51 points)
edited by
Sure editing the question and please help with ASAP.
@janad Can you please look into it now?
by Contributing Tester (99 points)
You are inspecting the input field. When you try to inspect the popup message, what happens?
by Contributing Tester (51 points)
When i make right click to inspect  popup then it gets disappeared.
by Contributing Tester (99 points)
Okay... Away for lunch. Will respond in a while
by Master (1.2k points)
Can you click on this https://imgur.com/htS096T and move to the element to observe?

If this does not help also, you can work with develop and identify what element it is and change its CSS value from display:hidden to display:block;
by Contributing Tester (51 points)
No this does not help . And developer said we have used already defined function for it so you can not get text it. there is something with this required="required" in html code.

 
Here is html code for it.

<input name="phone_number" type="text" maxlength="10" onkeyup="if (/\D/g.test(this.value)) this.value = this.value.replace(/\D/g,'')" id="phone_number" class="form-control" required="required">
by Contributing Tester (99 points)
Yes. I see how it works. What I understood is that, the developer executes a JavaScript that will do the validation and generate pop-up when the field is blank.

The key is to get that JS function and what element is generated. Once you know the element, it should be easier to work with.
by Contributing Tester (99 points)
Check what JS is being executed when submit button is clicked. From there you can identify script that is doing the validation.
by Contributing Tester (51 points)
I will ask to developer about the same.
0 like 0 dislike
by
you can use sikuli for this scenario to automate, with sikuli you can always look for the alert message


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...