How can I insert a c # string into the script?
string teste = "testando";
chromeBrowser.ExecuteScriptAsync("$(document).ready(function() {alert({0})}); ", teste);
I tried this code but it did not return anything
How can I insert a c # string into the script?
string teste = "testando";
chromeBrowser.ExecuteScriptAsync("$(document).ready(function() {alert({0})}); ", teste);
I tried this code but it did not return anything
The script you are trying to run is in the jquery syntax, the page will probably not recognize this of course, so I suggest you write javascript purely for this, an example would be to do this:
script = "document.addEventListener('DOMContentLoaded', function(){ alert('qualquer coisa'); });";
Still, if you want to use jquery, I suggest following the link .