findbycontent how to use variable

2 posts, 0 answers
  1. joe
    joe avatar
    5 posts
    Member since:
    Jan 2011

    Posted 28 Feb 2011 Link to this post

    How can I use a variable in the code "searchLnk = ActiveBrowser.Find.ByContent(contentvalue);" 

    Where conentvalue was previously defined by contentvalue = “btnG”;

    Rather than searchLnk = ActiveBrowser.Find.ByContent(”btnG”);


    is there a way NOT to have to use a LITERAL value?

    thanks joe

  2. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 04 Mar 2011 Link to this post

    Hi joe,

    Sure. Try something like this:

    string content = "My content";
    Element myElement = ActiveBrowser.Find.ByExpression("TextContent=" + content);

    Also check out this documentation.

     

    Greetings,
    Cody
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top