Trying to execute JavaScript using Selenium Driver but encountering an exception stating that the input string is in an incorrect format. The provided path contains the necessary JavaScript function, which is essentially an onclick without parameters, returning a value needed for further calculations.
Driver.Manage().Timeouts().SetScriptTimeout(TimeSpan.FromSeconds(5));
var js = Driver as IJavaScriptExecutor;
var formobject = js.ExecuteAsyncScript(
"var callback = arguments[0];"
+ "var params = arguments;"
+ "require(['Recruiting/Modules/CandidateProfile'],function(onPrint){"
+ "onPrint("
+ ",callback"
+ ");});"
);