I'm trying to find a way to input the receipt number and click the 'Check Status' button on this website: https://egov.uscis.gov/
I can successfully enter a receipt number:
document.getElementById('receipt_number').value = '\(receiptNumber)';
But the 'Check Status' button remains disabled. I can enable the button with:
document.getElementsByName('initCaseSearch')[0].removeAttribute("disabled");
But even with it enabled I still can't click it (errors as 'undefined'). It looks like the webpage has some additional logic or validation that prevents automated form submission, so I tried:
document.forms[0].submit();
But it just reloads the page and doesn't take the input receipt number.
Any ideas?
I dont know about evaluateJS But As far as I searched , Since the website is using ReactJS app, you can't do anything like that using evaluateJS. You should consider using WKScriptMessageHandler to do that.
The way to do that in browser is like this :
I should remind you to replace the value with desired value and change code according to your needs.
**Update : **
Sample Recommended Code to do it with WKScriptMessageHandler :
Caution : Do not use this code for automation that might hurt validation process of site or doing illegal things.