I have a question regarding what is the best Practice for Clicking the Element
1) Click by Selenium Webdriver Click Event or
2) or below ClickbyJS method.
public static void ClickByJS(IWebElement element, string name)
{
try
{
IJavaScriptExecutor js = _driver as IJavaScriptExecutor;
js.ExecuteScript("arguments[0].click();", element);
}
catch (Exception ex)
{
throw new ApplicationException("Unable to click " + name, ex);
}
}
Reason for asking is due to new Specflow version 2.53 and Firefox 45 most of the places normal selenium click event is not working the way it used to work. So i'm replacing most of the click event with above ClickbyJS method but i need to know is that the right solution for it ?
please let me know if i use ClickByJS is not over killing actual action of users towards browser.
Aucun commentaire:
Enregistrer un commentaire