Forum Discussion

BigDuy01's avatar
New Contributor
8 years ago

search for text (span) on webpage

I'm trying to search for    <span class="error-server-side" >   I tried using    obj = page["NativeWebObject"]["Find"]("contentText", "*error-server*");   but it never finds it.     I tried...
  • baxatob's avatar
    8 years ago



    First of all "error-server-side" is not the value of the contentText property, it's a name of the class.


    If you want to find this element, use:

    page.Find("className", "*error-server*", 10); /* 10 - is the value of the depth 
    for searching the element
    in the object's tree */


    More about the Find() method >>

  • joseph_michaud's avatar
    8 years ago

    Works for me.  Try experimenting only with Find() and strip out everything else.


    function Test2()
      var browser;
      var page;
      var obj;
      browser = Sys["Browser"]();
      page = browser["Page"]("");
      obj = page["Find"]("className", "*error-server*", 10);