webview.Eval("var list = document.getElementsByClassName('some button class')[0].click();");
webview.Eval("document.getElementById('savebutton').click();");
From the first instruction, the program enters a page where there is a save button, then the second line would be to click the save button.
This whole code should run when I press a button but my problem is that when I press the button, only the first instruction is executed. If I press the button again, the second half will also be executed.
Does anyone have any idea what to do? Thank you in advance for your help!
Solved: I used Device.StartTimer() method to delay the execution of the second line.
TimeSpan delay = new TimeSpan(0, 0, 3);
Device.StartTimer(delay, DelayHandler);
webview.Eval("var list = document.getElementsByClassName('some button class')[0].click();");
bool DelayHandler()
{
webview.Eval("document.getElementById('savebutton').click();");
return false;
}