I'm learning Awesomium and following is the code in which I'm trying to login to https://accounts.google.com. I'm successfully able to set the login and password field values in the page, but not able to submit the login form, neither does the click works. Can anyone help me how to login?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Awesomium.Core;
namespace Awesom
{
class Program1
{
public static void Main(String[] args)
{
Console.WriteLine("Started....");
WebView wv = WebCore.CreateWebView(1024, 600);
wv.Source = new Uri("https://accounts.google.com");
wv.LoadingFrameComplete += (s, e) =>
{
if (!e.IsMainFrame)
return;
dynamic document = (JSObject) wv.ExecuteJavascriptWithResult("document");
using(document)
{
//Works
var tbox = document.getElementById("Email");
tbox.value = "XXXXXXXX@gmail.com";
//Works
var pbox = document.getElementById("Passwd");
pbox.value = "**********";
//Doesnt work
var lform = document.getElementById("gaia_loginform");
lform.submit();
//Doesnt work
var sbox = document.getElementById("signIn");
sbox.click();
}
BitmapSurface surface = (BitmapSurface)wv.Surface;
surface.SaveToPNG("result.png", true);
WebCore.Shutdown();
};
WebCore.Run();
}
}
}
Result image: