This is a migrated thread and some comments may be shown as answers.

findbycontent how to use variable

1 Answer 44 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
joe
Top achievements
Rank 1
joe asked on 28 Feb 2011, 11:02 PM

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

1 Answer, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 05 Mar 2011, 12:06 AM
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!
Tags
General Discussions
Asked by
joe
Top achievements
Rank 1
Answers by
Cody
Telerik team
Share this question
or