-3
I was doing some tests with automation Javascript/jQuery and I came across some websites that it is not possible to fill in the entries correctly.
This would normally work on most websites:
$("#usuário").val('MY_USER')
$("#pass").val('MY_PASSWORD')
$("#send").click()
But on some specific websites, it doesn’t work. Is there any way to create code that works on any input?
It seems to me that one of the websites I’m testing checks the event of keydown to insert the value to the input.
This question is outside the scope of the Stack Overflow in Portuguese, write only questions in Brazilian Portuguese here, or use the Stack Overflow to publish this question.
– mauricio-andre
Sorry! I edited for English!
– Renato Marques
There is an accent on the name of one of the inputs
$("#usuário").val('MY_USER')
this may be a cause. I have seen sites have incorrect elements with the sameID
, if one of the websites you are testing has this condition this may also be a problem. Useconsole.log($("#usuário"))
to know if the element returned by this query actually corresponds to the input desired, and if possible share one of the websites that your code does not work as well as the code used to have a test case.– mauricio-andre