Cefsharp winforms, using loop to extract data from html - cefsharp

How can use a loop to extract data from a grid? Using DOM or javascript
I have tried understanding how DOM component works but was unsuccesful

Related

how to disply html style in flex with dynamically html data bind

Hi i am new to Flex webapp.
I want to dynamically bind html text with flex webapplication. I fetch html data from database using webservice and binding with textarea control. While binding data it displaying all text but without style applied for text.
I tried following code for bind
txtArea.textFlow = TextConverter.importToFlow(str,TextConverter.TEXT_FIELD_HTML_FORMAT);
Your code above should work, most likely the html is malformed.
TextConverter.export(textArea.textFlow, TextConverter.TEXT_FIELD_HTML_FORMAT, ConversionType.STRING_TYPE).toString();
I use this code to generate the html, where I can reload and reapply the styles using the exact same code as you do.
Also you should start out with
<TEXTFORMAT>
in your saved htmltext if you aren't.

Kendo UI Grid View Doesn't re-bind data- attributes

I am using Kendo-UI's Grid along with the knockout-kendo scripts and I've come across a problem that I think I'm missing something silly for.
I have a few links posted in one of the grid columns, and in that I'm using knockout to set some of the attributes including a data- attribute as so:
<a class="copyBooking" data-bind="attr: { 'data-bookingid': BookingId }">Copy</a>
I also have a small piece of Javascript that is set to run when the link is clicked:
$(".copyBooking").click(function(){
var bookingId = $(this).data("bookingid");
//code to access a function via ajax'
});
All seems fine on the initial load as the code within the Javascript runs and my alert comes back with the expected results. However, when I change pages the in Kendo Grid (I have my data paged to only show 10 results at a time) something stops the Javascript from functioning.
According to the HTML generated in Firebug or it's equivalent in Chrome, the data- attribute is set correctly in the HTML, so I'm no sure if the .click isn't firing correctly or if the data- attribute itself isn't being picked up correctly.
Does anyone have any suggestions?
As the element doesn't exist after you page through your grid. You need to have this function run on the databound event so that after the grid is re-rendered it will be applied to the 'new' dom element.
The other option would be to extend your knockout model of your rows with a function and click-bind to that.

Cloning usercontrol using Jquery

Page contains four grid with same no of columns.so, i have created a usercontrol which i am dragging four times on my page so it has created. uc1:grid1,uc1:grid2,uc1:grid3,uc1:grid4.
This means after rendering it will fetch four grids from the server. So If i create a grid & using Jquery .clone() i.e $(grid).clone() If i create 3 clones I can reduce server overhead. Is there any problem using this method?
If after cloning you need other data manipulation like changing headers and CSS and stuff like that, then sticking to your server code is more reasonable. But if you have 4 identical grids, int both structure and data, and they all have the same styles, then choose clone() method.

Testing ASP.NET sites using master pages with Selenium

What is a good approach to avoiding Selenium tests being broken when dealing with the changing "Name" and "Id" attributes of a control that is rendered on a ASP.NET page using a master page? I want to avoid changing my tests when ASP.NET renders the web page's controls with different DOM identifiers.
http://www.stevetrefethen.com/blog/AutomatedTestingOfASPNETWebApplicationsUsingSelenium.aspx
Selenium
solves this problem using XPATH and
providing the ability to locate
controls based on XPATH expressions,
alleviating the need to hard code HTML
tag structure into a test script. For
example, the ASP.NET runtime may
render ID attributes that look like:
id="ctl00_cphContents_gridMaint_DataGrid"
Finding this control using an XPATH
expression can be simplified to
something like this:
table[contains(#id, "gridMaint")]
In the event the nesting of the
DataGrid changes the script will
continue to function properly as long
as table's ID contains the text
"gridMaint".
Another option is to use CSS locators. They're normally less fragile than XPath. For example, to target a div with a class of .myDiv you can use the locator "css=.myDiv". If the specified element has other classes the CSS locator will still work, although the XPath equivalent would change from "//div[#class='myDiv']" to "//div[contains(#class, 'myDiv']". Also, CSS locators tend to be faster than XPath across browsers.

Flex XML elements vs. code

It's possible within a Flex application, to declare elements, for example a HTTPService elements, both in XML and also in code.
That is, either:
...
or in code:
var hs : HTTPService = ...
My question is when should I prefer which alternative? What are the advantages of having stuff in XML vs. plain old vars in code?
MXML is great for doing declarative layouts, much easier to follow than doing everything programmatically in ActionScript. If you are using something like a ServiceLocator to define HTTPService, RemoteObject, etc in your app then declaring them via MXML is also quick and easy. Basically if you want to add anything to an object's displayList quickly and easily, MXML is a great way.
Elements are more concise and compact than AS3 code, tho of course ultimately it all becomes the same thing. You can, for example in 'one line' of mxml declare an HTTPService and set several of its properties. In script you'd need to do this in many lines of init code. If you have a lot of global variables this can start to become unruly.

Resources