Good day,
I am attempting to automatically fill in some login details within a webView on an android.
So far i have the website loaded in the webview, i used:
webView.loadUrl("http://blabla");
now I need to fill in the login details. I have attempted to do so with the following code:
webView.loadUrl("javascript: {"
+ " var y=document.getElementsByTagName('input');"
+ " document.write('0:' + y[0].value + '<br>')"
+ " y[0].value = '" + username + "';"
+ " y[1].value = '" + password + "';}");
But that is not working, So i tried a simpler task to check that my javascript is working. So i ran this:
webView.loadUrl("javascript:alert('hello');");
But even that does nothing when running it.
I have enable javascript for the webview:
WebSettings webSet = webView.getSettings();
webSet.setJavaScriptEnabled(true); // enable java script
What am i doing wrong? Thanks