Hi, Try to get the element's xpath property using Firebug add-in.Using this u can get the exact property.
Regards, Suman CH On Sat, Sep 28, 2013 at 1:28 AM, <[email protected]> wrote: > ** > Is it behaving only for Label tag? > > Sent on my BlackBerry® from Vodafone > ------------------------------ > *From: * Wayne Hirata <[email protected]> > *Sender: * [email protected] > *Date: *Fri, 27 Sep 2013 12:51:45 -0700 (PDT) > *To: *<[email protected]> > *ReplyTo: * [email protected] > *Subject: *xpath LABEL[@for='aaa'] fails to recognize element > > I am using descriptive programming to find a LABEL by its "for" attribute. > > I am successful using xpath with the class attribute: > Browser().Page().WebElement("xpath:=//LABEL[@class='mytext']") > > Using the "for" attribute FAILS to identify the element. > Browser().Page().WebElement("xpath:=//LABEL[@for='mytext']") > > Here is the html: > <html> > <head><title>qtp xpath test</title></head> > <body> > <label for="mytext" class="mytext">Name:</label> > <input id="mytext" name="mytext" type="text"> > </body> > </html> > > Is there a method to identify a LABEL element when the LABEL only has the > "for" attribute. My real life test case has only the "for" attribute. I > would like to validate the innertext property. > > -- > -- > You received this message because you are subscribed to the Google > "QTP - HP Quick Test Professional - Automated Software Testing" > group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/MercuryQTP?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "QTP - HP Quick Test Professional - Automated Software Testing" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > -- > -- > You received this message because you are subscribed to the Google > "QTP - HP Quick Test Professional - Automated Software Testing" > group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/MercuryQTP?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "QTP - HP Quick Test Professional - Automated Software Testing" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- -- You received this message because you are subscribed to the Google "QTP - HP Quick Test Professional - Automated Software Testing" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/MercuryQTP?hl=en --- You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
