none
get elements with WATIN

    Frage

  • How can i get all elements names like (Button, image, table, div) in frame?

    I search for elements but it returns me all elements like (div,td, th, tr,) but i want that it return only frames child elements not div or table child elements to.

    I do this:

      //in IE i get all webs source code    

    IE ie = new IE("http://192.168.205.10")

    int a = 0; foreach (Frame e in ie.Frames) { txt.Text += "FRAME : " + e.Name; list.Items.Add(e.Name); tview.Nodes.Add(e.Name); foreach (Element e1 in e.Elements) { //txt.Text += "\t\t" + e1.TagName; if (e1.IdOrName != null) { tview.Nodes[a].Nodes.Add(e1.TagName); } } a++; }





    • Bearbeitet aivarinns Montag, 16. April 2012 10:30
    Montag, 16. April 2012 08:08

Antworten

Alle Antworten

  • Plzz help!
    Montag, 16. April 2012 09:26
  • I assume that you are talking about HTML frames. If so the something here might help. I'm not really familiar with HTML except at a basic level so can't suggest a solution.

    Regards David R
    ---------------------------------------------------------------
    The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones.
    Object-oriented programming offers a sustainable way to write spaghetti code. - Paul Graham.
    Every program eventually becomes rococo, and then rubble. - Alan Perlis
    The only valid measurement of code quality: WTFs/minute.

    Montag, 16. April 2012 09:42
  • Show more details about the kind of your program. What is ie?

    Montag, 16. April 2012 09:42
  • IE ie = new IE("http://192.168.205.10")
    Montag, 16. April 2012 10:13
  • And of course that leads to the question: What is IE? :)

    Regards David R
    ---------------------------------------------------------------
    The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones.
    Object-oriented programming offers a sustainable way to write spaghetti code. - Paul Graham.
    Every program eventually becomes rococo, and then rubble. - Alan Perlis
    The only valid measurement of code quality: WTFs/minute.

    Montag, 16. April 2012 10:20
  • It looks like you are using a third-party library – WatiN. Since we are not familiar with it, maybe you can check if Element class has a member that denotes the type of element.

    Montag, 16. April 2012 10:31
  • Please check following link, it may be helpful to you.

    http://stackoverflow.com/questions/1724915/watin-search-in-children-of-an-element

    Montag, 16. April 2012 17:22