acs::test::find_link (public)
acs::test::find_link -last_request last_request [ -user_id user_id ] \ [ -base base ] [ -label label ]
Defined in packages/acs-automated-testing/tcl/aa-test-procs.tcl
Find the first link based on the provided label and return the href.
- Switches:
- -last_request (required)
- -user_id (optional, defaults to
"0"
)- -base (optional, defaults to
"/"
)- -label (optional)
- Author:
- Gustaf Neumann
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- fs_add_file_to_folder
Source code: set href "" set html [dict get $last_request body] acs::test::dom_html root $html { foreach a [$root selectNodes //a] { set link_label [string trim [$a text]] if {$label eq $link_label} { set href [$a getAttribute href] break } # # There is something weird in tDOM: without the # "string trim" we see something like # # a TEXT 'DD25C9878' = 'DD25C9878' eq 0 77 9 # # from the statements below. # set eq [expr {$label eq $link_label}] # aa_log "a TEXT '$link_label' = '$label' eq $eq [string length $link_label] [string length $label]" # aa_log "a TEXT '[$a asHTML]'" } } aa_true "href '$href' of link with label '$label' is not empty (<a href='[detail_link $last_request]'>Details</a>)" {$href ne ""} if {![string match "/*" $href]} { set href $base/$href } return $hrefXQL Not present: Generic, PostgreSQL, Oracle