I wanted to automatically submit a form.
OR
I wanted to automatically click on button.
Note: There is no button/form name,id or any other details.Just some text can be seen on button as "Submit".
Would be great if any java script code is provided.
Thanks
HtmlElementCollection htmlelements = _windowManager.ActiveBrowser.Document.GetElementsByTagName("input");
foreach (HtmlElement element in htmlelements)
{
if ((element.GetAttribute("title") == PasswordText) || (element.GetAttribute("name") == PasswordText) || (element.GetAttribute("id") == PasswordText) || (element.GetAttribute("value") == PasswordText))
{
element.InvokeMember("Click");
}
}
I am trying to use aboce code but it is not working