in reply to Keyword parser function mapping module

require "testsuite.pl"; open_browser(optional machine info); goto ("http://some.url"); verify_page(some info to verify); set_form (field1 => "value1", field2 => "value2"); submit_form(optional button or image to click); verify_page(some info to verify);

Seriously, they wouldn't need to learn Perl, per se, in order to write Perl scripts that do nothing but call functions that you've predefined. Learning this syntax wouldn't be significantly harder than learning the syntax you laid out, and it saves you the trouble of writing a parser; all you have to do is write the procedures.

I've used a system comparable to this successfully. My sister, an end user, writes quizzing questions using my quizques mode in Emacs. She doesn't do anything else in Emacs and does not know *any* of the standard Emacs stuff (most notably, she does not know about Ctrl-C anything, Ctrl-X anything, or M-x anything). She just uses the mode that I set up. You can do the same thing with Perl. Write your code so that they don't have to do anything but call your prefab procedures.


$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/

Replies are listed 'Best First'.
Re: Re: Keyword parser function mapping module
by dragonchild (Archbishop) on Jan 06, 2004 at 16:21 UTC
    Writing the parser is easier in the long run, because it allows the testers to define their own "functions", so to speak. And, if the event handlers (which are your functions) are well defined (and OO, if possible), then enterprising QA people can overload their own events. :-)

    ------
    We are the carpenters and bricklayers of the Information Age.

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

      Writing the parser is easier in the long run, because it allows the testers to define their own "functions"

      Could you clarify what you mean by this? The only meaning I can make out for it requires them to learn Perl. I assume that's not what you meant, since it was expressly stated they don't want to do that, and also because your use of quotation marks around "functions" seems to indicate a different a different meaning, but I'm not sure what. How could non-programmers define their own "functions"?


      $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
        Essentially, you'd create your own macro language. Something along the lines of:
        SUB my_func COMMAND1 COMMAND2 ENDSUB ... Elsewhere ... CALL my_func

        Using JZ and JNZ (and a simple stack), it is very simple to implement this, but allows for your users to rapidly improve their testing scripts, especially when combined with a LoadCommands or #include or whatever.

        ------
        We are the carpenters and bricklayers of the Information Age.

        Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.