acs::test::xpath::get_form (public)

 acs::test::xpath::get_form node xpath

Defined in packages/acs-automated-testing/tcl/aa-test-procs.tcl

Locate the HTML forms matching the XPath expression and retrieve its HTML attributes and the formfields in form of a Tcl dict.

Parameters:
node
xpath
Returns:
Tcl dict with form attributes (keys starting with "@", and entry "fields")
Author:
Gustaf Neumann

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_folder_with_page create_folder_with_page (test xowf) acs::test::xpath::get_form acs::test::xpath::get_form test_create_folder_with_page->acs::test::xpath::get_form test_create_form_with_form_instance create_form_with_form_instance (test xowiki) test_create_form_with_form_instance->acs::test::xpath::get_form test_markup_parsing markup_parsing (test acs-automated-testing) test_markup_parsing->acs::test::xpath::get_form acs::test::xpath::get_form_values acs::test::xpath::get_form_values (public) acs::test::xpath::get_form->acs::test::xpath::get_form_values acs::test::get_form acs::test::get_form (public) acs::test::get_form->acs::test::xpath::get_form xowiki::test::create_form_page xowiki::test::create_form_page (public) xowiki::test::create_form_page->acs::test::xpath::get_form

Testcases:
markup_parsing, create_folder_with_page, create_form_with_form_instance
Source code:
        set d {}
        set formNodes [$node selectNodes $xpath]
        if {[llength $formNodes] > 1} {
            error "XPath expression must point to at most one HTML form"
        } else {
            #aa_log "xpath::get_form has form nodes '$formNodes'"
            foreach form $formNodes {
                foreach att [$node selectNodes $xpath/@*] {
                    #aa_log "xpath::get_form form '$form' has attribute '$att'"
                    dict set d @[lindex $att 0] [lindex $att 1]
                }
                dict set d fields [::acs::test::xpath::get_form_values $node $xpath]
            }
        }
        return $d
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: