I need to find an element in selenium 2 and I know that the link i’m looking for contains some defined text that I got in a varible. So this is how the link is:
<a id="ctl00_content_list_gvOtherSchemas_ctl02_lbViewSchema"
href="javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("ctl00$content$list$gvOtherSchemas$ctl02
$lbViewSchema", "", false, "",
"https://test/page.aspx?_InfoPath_Sentinel=1&
case=2011-015196&name=MyCase&version=2&p=PPC1&cc=ANSOEG&
py=2011&rn=CR274&c=0&st=DRAFT&oo=1&sc=SC001&hln=&
tl=31-12-2011 23:59:59&sa=&sai=&san=", false, true))"
>MyCase</a>
And I want to look for the text: “case=2011-015196” by an xpath expression.
A more specific expression that looks for the
aelement whosehrefattribute contains the target string:Or, more specifically: