If I hard code something into the conatins it works just fine

valstring = "[contains(title,'Test')]";

However if I try and use contains against the xpath title and then use what was entered into a text box I haven't figured out how to do that. I'm sure it's something very simple

valstring = "[contains(title, txtSearchVal)]";

Any Suggestions would be greatly appriciated

Recommended Answers

All 2 Replies

Depending on your language, could you use something like this?:

valstring = "[contains(title, " + txtSearchVal + ")]";

thines01,

Thank you very much. You were very close. Here is what ended up working for me

valstring = "[contains(title, "+ "'" + txtSearchval + "'" +")]";

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.