Login with javascript

Hi

I'm using cefsharp to automate aras.

I want to login programmatically using Javascript code.

I tried somthing like:

document.getElementById('username').value= 'xxxxx' ;

document.getElementById('password').value= 'xxxxx'

but it does not work.

how can i set the fields and click the login button via Javascript?

thanks