Welcome Guest Search | Active Topics | Sign In | Register

EO.WebBrowser click detect data change Options
devali
Posted: Friday, December 13, 2019 6:55:49 AM
Rank: Newbie
Groups: Member

Joined: 12/13/2019
Posts: 1
Hi,

We are testing one of your great product EO Webbrowser to automate a few things

I am a total novice in terms of web development, so if your reply include those technologies, I would really appreciate your patience.

Here is the scenario.

Website we're trying to automate is developed in ASP.Net

Step 1) Visit the search page. -- (Done)
Step 2) Fill fields with data and click a button to submit search. -- (Done)

Search result page probably has repeater for search result data

Step 3) Parse search result from the repeater (HTML Table) -- (Done)

Now the issue:

Each row in search result has a link that says Show Details ( basically <a> tag ), when we click the link it updates a panel (basically a <span> tag) asynchronously ( probably ajax/some asp.net update panel ) with more data.

<a> tag e.g.

Code: HTML/ASPX
<a id="ContentPlaceHolder1_MGVSearchResult_LnkShowDetails_0" class="LnkshowDetails" href="javascript:__doPostBack(&#39;ctl00$ContentPlaceHolder1$MGVSearchResult$ctl02$LnkShowDetails&#39;,&#39;&#39;)">Show Details</a>



I can do the clicking but how do get to know that the that panel is updated with the data?

I have tried many events e.g. BeforeNavigate, ScriptCall done etc. but none of them helped.

Regards,
DA
eo_support
Posted: Friday, December 13, 2019 4:22:13 PM
Rank: Administration
Groups: Administration

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

There is no built-in support for such specific tasks. First you will have to somehow to be notified of the event. If you have control over the page source, then the easiest way is to render a piece of JavaScript code inside the UpdatePanel, then when the UpdatePanel applies the new content, it would execute the JavaScript code. If you do not have control over the page source but the page code structure is known, then you can inject JavaScript code into the page to hook up some known event handler. For example, if you use ASP.NET UpdatePanel, you can handle PageRequestManager's endRequest event to be notified when the AJAX request is done.

The two things that EO.WebBrowser can provide you are:

1. Inject JavaScript code into the page. You can either use WebView.JSInitCode or WebView.EvalScript. The difference is JSInitCode is called before everything else and WebView.EvalScript must be called after the page is loaded;

2. Inside your JavaScript event handler, you can use eoapi.extInvoke to call back into the .NET side if needed. See here for more details:

https://www.essentialobjects.com/doc/webbrowser/advanced/jsext.aspx

Hope this helps. Please feel free to let us know if you have any more questions.

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.