I want to fill in recipient and sender fields on this website http://sms.orange.pl/ using bookmarked java script. I have done some googling, and that’s what I came up with:
$javascript:document.getElementByName("RECIPIENT").value='TEST';document.getElementByName("SENDER").value='TEST';
and
$javascript:document.getElementsByTagName('input')[2].value='TEST';document.getElementsByTagName('input')[5].value='TEST';
Unfortunately both won’t work. What’s wrong? I’m using Chrome.
I think that dollar sign at the beginning there is unnecessary. Try this instead:
Notice also that I added
return null;at the end. This is to stop the page from disappearing and just presenting you with the return value of the last statement, in this case,TEST.Also, if you’re looking for a more complete automated testing environment, have a Google for Selenium. It’s absolutely brilliant, and will be roughly a million times easier than making these javascript things.
Hope that helps.