Can't find element with HtmlFindExpression

2 posts, 0 answers
  1. Anton
    Anton avatar
    54 posts
    Member since:
    Sep 2011

    Posted 08 Aug 2012 Link to this post

    Sometime Expressions doesn't work.

    For example:

    public static readonly HtmlFindExpression ProjectLabelInProjectsTree = new HtmlFindExpression("id=projectTree", "|", "class=rf-tr-nd-colps", "|", "class=rf-trn-cnt");
    Find.ByExpression<HtmlSpan>(MainTestPageObjects.ProjectLabelInProjectsTree).Click();

    <div id="projectTree" class="rf-tr">
    <div id="projectTree:1st - Projects:j_idt43" class="rf-tr-nd rf-tr-nd-colps firefinder-match">
    <div id="j_idt43" class="rf-trn firefinder-match">
    <span class="rf-trn-hnd-colps rf-trn-hnd"></span>
    <span class="rf-trn-cnt rf-trn-sel">
    </div>
    </div>
    <div id="projectTree:2nd - Deploy Configurations:j_idt52" class="rf-tr-nd rf-tr-nd-lf rf-tr-nd-last">
    <div id="j_idt52" class="rf-trn firefinder-match">
    <span class="rf-trn-hnd-lf rf-trn-hnd"></span>
    <span class="rf-trn-cnt">
    </div>
    </div>

    code return exception - 

            • System.NullReferenceException: Object reference not set to an instance of an object.
  2. Anton
    Anton avatar
    54 posts
    Member since:
    Sep 2011

    Posted 09 Aug 2012 Link to this post

    Sorry, it's duplicate.

    answer here:

    link

Back to Top