Welcome Guest Search | Active Topics | Sign In | Register

Cannot retrieve DOM, null exception thrown. Options
Swatchqaws
Posted: Monday, October 3, 2016 10:24:26 PM
Rank: Newbie
Groups: Member

Joined: 10/3/2016
Posts: 5
Hi EO,

We used EO version is 16.1.17.0.

There is a strange problem, cannot retrieve DOM, null exception thrown.

This is how we call javascript function from .NET,

Code: C#
private void InvokeJS(string functionName, object[] parameters)
{
	try
	{
                if (_browser.CanEvalScript)
		{
			Console.WriteLine("Step 1");
			JSObject jsObj = _browser.GetDOMWindow();
			Console.WriteLine("Step 2");
			JSFunction functions = (JSFunction)_browser.EvalScript(functionName);
			Console.WriteLine("Step 3");
			functions.Invoke(jsObj, parameters);
                }
	}
	catch (Exception ex)
	{
		Console.WriteLine("An error has occurred: " + ex.ToString());
	}
}


In certain sites this function print at "Step 1" after without print "Step 2", look like while loop at GetDOMWindow() , and without thrown exception ex.

Is this a known issue?

Thanks

Best Regards,

Swatchqaws
eo_support
Posted: Tuesday, October 4, 2016 11:07:15 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

Please update to the latest build and see if that resolves the issue for you. Some website sends "content-security-policy" header entry that forbids JavaScript from other source. With old builds you will get null with EvalScript for such cases. We have recently changed our code to support this.

If the latest build still does not work, please PM us with the Url of the site so that we can investigate further from here.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.