[Solved] Path separators are missing

The issue is that your FileName has single slashes in it. JS will interpret those slashes as escape characters. The simplest solution is to replace your single slashes with double slashes: _mainWindow.Browser.ExecuteScriptAsync( “document.getElementById(‘location’).value=” + ‘\” + openFileDialog.FileName.Replace(@”\”, @”\\”) + ‘\”); solved Path separators are missing

[Solved] c# Cefsharp how to make correct sequence of JavaScript actions on the web site

As your JavaScript causes a navigation you need to wait for the new page to load. You can use something like the following to wait for the page load. // create a static class for the extension method public static Task<LoadUrlAsyncResponse> WaitForLoadAsync(this IWebBrowser browser) { var tcs = new TaskCompletionSource<LoadUrlAsyncResponse>(TaskCreationOptions.RunContinuationsAsynchronously); EventHandler<LoadErrorEventArgs> loadErrorHandler = null; EventHandler<LoadingStateChangedEventArgs> … Read more