feature request : finding simpler xpath locator

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

feature request : finding simpler xpath locator

Alexandre Garel
Just a though about a feature for selenium IDE as it pops up in my mind :
When the recorder try to find a locator, it try some recipes, then use
xpath. The generated Xpath is a complete traversal of the document down
to the element.
Why not try this heuristic :
try //element_type to see if it returns the target (and only the target)
if it fails, try to add each attribute of the element one by one till it
returns the target (given priority: id, name, type, text(), others....)
if it fails, add the parent of the element, then its attribute one by
one... and so on
It maybe a bit CPU consuming but I think that 90% of the time it would
result in a very short xpath (like //tr/td[@name='youpi']).

I like when the computer works for me ;-)

Alex.





Ce message est protégé par les règles relatives au secret des correspondances. Il est donc établi à destination exclusive de son destinataire. Celui-ci peut donc contenir des informations confidentielles. La divulgation de ces informations est à ce titre rigoureusement interdite. Si vous avez reçu ce message par erreur, merci de le renvoyer à l'expéditeur dont l'adresse e-mail figure ci-dessus et de détruire le message ainsi que toute pièce jointe.

This message is protected by the secrecy of correspondence rules. Therefore, this message is intended solely for the attention of the addressee. This message may contain privileged or confidential information, as such the disclosure of these informations is strictly forbidden. If, by mistake, you have received this message, please return this message to the addressser whose e-mail address is written above and destroy this message and all files attached.

_______________________________________________
Seleniumrecorder mailing list
[hidden email]
http://mozdev.org/mailman/listinfo/seleniumrecorder
Reply | Threaded
Open this post in threaded view
|

Re: feature request : finding simpler xpath locator

Shinya Kasatani
Hi Alexandre,

Sorry for this late reply.
Thanks for your idea. I've implemented something similar to that into
Selenium IDE.
You can try it by building it from svn, but anyways Selenium IDE will
be released really soon.

Shinya

On 27/01/06, Alexandre Garel <[hidden email]> wrote:

> Just a though about a feature for selenium IDE as it pops up in my mind :
> When the recorder try to find a locator, it try some recipes, then use
> xpath. The generated Xpath is a complete traversal of the document down
> to the element.
> Why not try this heuristic :
> try //element_type to see if it returns the target (and only the target)
> if it fails, try to add each attribute of the element one by one till it
> returns the target (given priority: id, name, type, text(), others....)
> if it fails, add the parent of the element, then its attribute one by
> one... and so on
> It maybe a bit CPU consuming but I think that 90% of the time it would
> result in a very short xpath (like //tr/td[@name='youpi']).
>
> I like when the computer works for me ;-)
>
> Alex.
>
>
>
>
>
> Ce message est protégé par les règles relatives au secret des correspondances. Il est donc établi à destination exclusive de son destinataire. Celui-ci peut donc contenir des informations confidentielles. La divulgation de ces informations est à ce titre rigoureusement interdite. Si vous avez reçu ce message par erreur, merci de le renvoyer à l'expéditeur dont l'adresse e-mail figure ci-dessus et de détruire le message ainsi que toute pièce jointe.
>
> This message is protected by the secrecy of correspondence rules. Therefore, this message is intended solely for the attention of the addressee. This message may contain privileged or confidential information, as such the disclosure of these informations is strictly forbidden. If, by mistake, you have received this message, please return this message to the addressser whose e-mail address is written above and destroy this message and all files attached.
>
> _______________________________________________
> Seleniumrecorder mailing list
> [hidden email]
> http://mozdev.org/mailman/listinfo/seleniumrecorder
>
_______________________________________________
Seleniumrecorder mailing list
[hidden email]
http://mozdev.org/mailman/listinfo/seleniumrecorder