Menu

#223 Extensible XPathAdapter

Latest SVN
open
nobody
None
1
2014-10-19
2014-09-30
No

It will be nice to have possibility to extend XPath with custom functions (and it can be possible after minor XPathAdapter modification).

Please find suggested patch in attachment.

1 Attachments

Discussion

  • Adam Afeltowicz

    Adam Afeltowicz - 2014-10-09

    Can anyone give a comment if this patch could be (or not) committed into main branch?

    Thanks in advance.

     

    Last edit: Adam Afeltowicz 2014-10-09
  • RBRi

    RBRi - 2014-10-09

    Hi Adam,

    did a quick lock. Two things:

    1. i miss a test case that proofs the functionality; something like adding a function and check that this function works
    2. making the funcTable_ public might not be the most elegant way to allow extensions. I would prefer some kind of api here.
     

    Last edit: RBRi 2014-10-10
    • Adam Afeltowicz

      Adam Afeltowicz - 2014-10-13

      Hi Ronald,

      please let me know if you are satisfied with my answers.

       

      Last edit: Adam Afeltowicz 2014-10-13
  • Adam Afeltowicz

    Adam Afeltowicz - 2014-10-10

    Hi Ronald,

    ad 2) I agree that public field isn't elegant, but I think that FunctionTable class provides sufficient api itself, so making its instance a public static final field should be enough. I didn't find a reason why this class couldn't be a "raw" singleton as it contains only information about available XPath functions in key-value manner (schematically).

     

    Last edit: Adam Afeltowicz 2014-10-10
  • Adam Afeltowicz

    Adam Afeltowicz - 2014-10-10

    ad 1) Please find example usage in attachment

     
  • RBRi

    RBRi - 2014-10-19

    Hi Adam,
    sorry for the slow progress on this topic.
    Thanks for the sample.
    I still have a question. What is your use case for this extension. Is this something that you can do with real browsers also?

     
    • Adam Afeltowicz

      Adam Afeltowicz - 2014-10-20

      Hi Ronald,

      as far as I know custom XPath functions cannot be defined for real browsers - that's why this ticket is FR ;). We run testscripts defined in textfiles (so they can be prepared independently to testtool development) using HtmlUnit and sometimes standard XPath functions are not sufficient to repeat whole scenario. Of course each case could be wrapped as special actions, but this seems less flexible.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.