regex - selenium regular expression such as id=regexp:.* doesn't work -
i have .aspx page , i'm trying locate textbox via selenium ui. id is: p_lt_ctl01_pageplaceholder_p_lt_ctl00_signupfree_txtfirstname
i've tried: id=*._txtfirstname and: id=glob:*_txtfirstname
is there better way other css locate textbox id may change each time it's compiled?
you can't put wildcards in id "selector". either use id=whole_id_here or don't.
fortunately, case, can use css selector:
[id*=_txtfirstname] in selenium ide, use like:
css=[id*=_txtfirstname] example selenium ide source snippet:
<tr> <td>storetext</td> <td>css=[id*=_txtfirstname]</td> <td>x</td> </tr> <tr> <td>echo</td> <td>${x}</td> <td></td> </tr> note: if _txtfirstname @ end, can use css locator $ instead of * (it more restrictive, match if @ end, while * matches if anywhere): [id$=_txtfirstname]. (in selenium ide, naturally, use like: css=[id$=_txtfirstname].)
Comments
Post a Comment