Skip to main content

I think below might be better to use:

var JSExecute = (IJavaScriptExecutor)Chromedriver;
JSExecute.ExecuteScript("arguments[0].focus();", _UIControl[0]);
JSExecute.ExecuteScript($"arguments[0].setAttribute('value', '{CrtlValue}')", _UIControl[0]);

var JSExecute = (IJavaScriptExecutor)Chromedriver;                                
JSExecute.ExecuteScript("arguments[0].focus();", _UIControl[0]);                
JSExecute.ExecuteScript($"arguments[0].setAttribute('value', '{CrtlValue}')", _UIControl[0]);

I think below might be better to use:

var JSExecute = (IJavaScriptExecutor)Chromedriver;
JSExecute.ExecuteScript("arguments[0].focus();", _UIControl[0]);
JSExecute.ExecuteScript($"arguments[0].setAttribute('value', '{CrtlValue}')", _UIControl[0]);

I think below might be better to use:

var JSExecute = (IJavaScriptExecutor)Chromedriver;                                
JSExecute.ExecuteScript("arguments[0].focus();", _UIControl[0]);                
JSExecute.ExecuteScript($"arguments[0].setAttribute('value', '{CrtlValue}')", _UIControl[0]);
Source Link

I think below might be better to use:

var JSExecute = (IJavaScriptExecutor)Chromedriver;
JSExecute.ExecuteScript("arguments[0].focus();", _UIControl[0]);
JSExecute.ExecuteScript($"arguments[0].setAttribute('value', '{CrtlValue}')", _UIControl[0]);