(command.CommandList children: [ (command.Simple blame_tok: <set> more_env: [] words: [{<set>} {<-o>} {<pipefail>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <shopt> more_env: [] words: [{<shopt>} {<-s>} {<extglob>}] redirects: [] do_fork: T ) (command.ShFunction name_tok: <main> name: main body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <Id.Lit_Colon ':'> more_env: [] words: [ {<Id.Lit_Colon ':'>} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name WEBDRIVER_URL> var_name: WEBDRIVER_URL suffix_op: (suffix_op.Unary op: <Id.VTest_ColonEquals _> arg_word: {<'http:'> <Id.Lit_Slash '/'> <Id.Lit_Slash '/'> <'127.0.0.1:4444'> <Id.Lit_Slash '/'> <wd> <Id.Lit_Slash '/'> <hub> } ) right: <Id.Right_DollarBrace '}'> ) ) } ] redirects: [] do_fork: T ) (command.Sentence child: (command.ShAssignment left: <Id.Lit_VarLike 'cmd='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'cmd='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'cmd='> name:cmd) op: assign_op.Equal rhs: {($ Id.VSub_Number 1)} ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.Case case_kw: <Id.KW_Case case> to_match: (case_arg.Word w:{($ Id.VSub_DollarName cmd)}) arms_start: <Id.KW_In in> arms: [ (CaseArm left: <new-session> pattern: (pat.Words words:[{<new-session>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-new-session> more_env: [] words: [{<wd-new-session>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <delete-session> pattern: (pat.Words words:[{<delete-session>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-delete-session> more_env: [] words: [{<wd-delete-session>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <go> pattern: (pat.Words words:[{<go>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-go> more_env: [] words: [{<wd-go>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <back> pattern: (pat.Words words:[{<back>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-post-session> more_env: [] words: [{<wd-post-session>} {<'/back'>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <forward> pattern: (pat.Words words:[{<forward>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-post-session> more_env: [] words: [{<wd-post-session>} {<'/forward'>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <refresh> pattern: (pat.Words words:[{<refresh>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-post-session> more_env: [] words: [{<wd-post-session>} {<'/refresh'>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <get-current-url> pattern: (pat.Words words:[{<get-current-url>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-get-current-url> more_env: [] words: [{<wd-get-current-url>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <get-title> pattern: (pat.Words words:[{<get-title>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-get-title> more_env: [] words: [{<wd-get-title>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <get-page-source> pattern: (pat.Words words:[{<get-page-source>} {<page-source>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-get-page-source> more_env: [] words: [{<wd-get-page-source>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <get-window-handle> pattern: (pat.Words words:[{<get-window-handle>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-get-window-handle> more_env: [] words: [{<wd-get-window-handle>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <get-window-handles> pattern: (pat.Words words:[{<get-window-handles>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-get-window-handles> more_env: [] words: [{<wd-get-window-handles>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <switch-to-window> pattern: (pat.Words words:[{<switch-to-window>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-switch-to-window> more_env: [] words: [{<wd-switch-to-window>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <switch-to-frame> pattern: (pat.Words words:[{<switch-to-frame>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-switch-to-frame> more_env: [] words: [{<wd-switch-to-frame>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <switch-to-parent-frame> pattern: (pat.Words words:[{<switch-to-parent-frame>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-post-session> more_env: [] words: [{<wd-post-session>} {<'/frame/parent'>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <get-window-size> pattern: (pat.Words words:[{<get-window-size>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-get-window-size> more_env: [] words: [{<wd-get-window-size>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <set-window-size> pattern: (pat.Words words:[{<set-window-size>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-set-window-size> more_env: [] words: [{<wd-set-window-size>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <maximize> pattern: (pat.Words words:[{<maximize>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-maximize> more_env: [] words: [{<wd-maximize>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <find-element> pattern: (pat.Words words:[{<find-element>} {<find>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-find-element> more_env: [] words: [{<wd-find-element>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <find-elements> pattern: (pat.Words words:[{<find-elements>} {<find-all>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-find-elements> more_env: [] words: [{<wd-find-elements>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <find-element-in> pattern: (pat.Words words: [{<find-element-in>} {<find-in>} {<find-element-from-element>}] ) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-find-element-from-element> more_env: [] words: [{<wd-find-element-from-element>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <find-elements-in> pattern: (pat.Words words: [{<find-elements-in>} {<find-all-in>} {<find-elements-from-element>}] ) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-find-elements-from-element> more_env: [] words: [{<wd-find-elements-from-element>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <get-element-attribute> pattern: (pat.Words words:[{<get-element-attribute>} {<attr>} {<attribute>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-get-element-attribute> more_env: [] words: [{<wd-get-element-attribute>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <get-element-css-value> pattern: (pat.Words words:[{<get-element-css-value>} {<css-value>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-get-element-css-value> more_env: [] words: [{<wd-get-element-css-value>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <get-element-text> pattern: (pat.Words words:[{<get-element-text>} {<text>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-get-element-text> more_env: [] words: [{<wd-get-element-text>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <get-element-tag-name> pattern: (pat.Words words:[{<get-element-tag-name>} {<tag-name>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-get-element-tag-name> more_env: [] words: [{<wd-get-element-tag-name>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <is-element-selected> pattern: (pat.Words words:[{<is-element-selected>} {<is-selected>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-is-element-selected> more_env: [] words: [{<wd-is-element-selected>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <is-element-enabled> pattern: (pat.Words words:[{<is-element-enabled>} {<is-enabled>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-is-element-enabled> more_env: [] words: [{<wd-is-element-enabled>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <element-click> pattern: (pat.Words words:[{<element-click>} {<click>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-element-click> more_env: [] words: [{<wd-element-click>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <element-clear> pattern: (pat.Words words:[{<element-clear>} {<clear>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-element-clear> more_env: [] words: [{<wd-element-clear>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <element-send-keys> pattern: (pat.Words words:[{<element-send-keys>} {<send-keys>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-element-send-keys> more_env: [] words: [{<wd-element-send-keys>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <execute-script> pattern: (pat.Words words:[{<execute-script>} {<execute>} {<exec>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-execute-script-sync> more_env: [] words: [{<wd-execute-script-sync>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <execute-script-async> pattern: (pat.Words words: [{<execute-script-async>} {<execute-async>} {<exec-async>}] ) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-execute-script-async> more_env: [] words: [{<wd-execute-script-async>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <get-all-cookies> pattern: (pat.Words words:[{<get-all-cookies>} {<cookies>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-get-all-cookies> more_env: [] words: [{<wd-get-all-cookies>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <get-named-cookie> pattern: (pat.Words words:[{<get-named-cookie>} {<cookie>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-get-named-cookie> more_env: [] words: [{<wd-get-named-cookie>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <add-cookie> pattern: (pat.Words words:[{<add-cookie>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-add-cookie> more_env: [] words: [{<wd-add-cookie>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <delete-cookie> pattern: (pat.Words words:[{<delete-cookie>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-delete-cookie> more_env: [] words: [{<wd-delete-cookie>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <delete-cookies> pattern: (pat.Words words:[{<delete-cookies>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-delete-cookies> more_env: [] words: [{<wd-delete-cookies>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <take-screenshot> pattern: (pat.Words words:[{<take-screenshot>} {<screenshot>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-take-screenshot> more_env: [] words: [{<wd-take-screenshot>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <take-element-screenshot> pattern: (pat.Words words:[{<take-element-screenshot>} {<element-screenshot>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <wd-take-element-screenshot> more_env: [] words: [{<wd-take-element-screenshot>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <help> pattern: (pat.Words words:[{<help>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <print-help> more_env: [] words: [{<print-help>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <Id.Lit_Star '*'> pattern: (pat.Words words:[{<Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <cat> more_env: [] words: [{<cat>}] redirects: [ (Redir op: <Id.Redir_GreatAnd '>&'> loc: (redir_loc.Fd fd:1) arg: {<2>} ) (Redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<.>} here_end_tok: <Id.Undefined_Tok ''> stdin_parts: [<'Usage: wd <command> [arguments]\n'> <'Help: wd help\n'>] ) ) ] do_fork: T ) (command.ControlFlow keyword: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] right: <Id.Op_DSemi _> ) ] arms_end: <Id.KW_Esac esac> redirects: [] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <die> name: die body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.ShAssignment left: <Id.Lit_VarLike 'rc='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'rc='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rc='> name:rc) op: assign_op.Equal rhs: {($ Id.VSub_Number 1)} ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.Simple blame_tok: <echo> more_env: [] words: [{<echo>} {(DQ ($ Id.VSub_Number 0) <':'>)} {(DQ ($ Id.VSub_At '@'))}] redirects: [(Redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})] do_fork: T ) terminator: <Id.Op_Semi _> ) (command.ControlFlow keyword: <Id.ControlFlow_Exit exit> arg_word: {(DQ ($ Id.VSub_DollarName rc))} ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <json-obj> name: json-obj body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <perl> more_env: [] words: [ {<perl>} {<-mJSON> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <PP>} {<-e>} { (SQ <'\n'> <' use List::Util qw(pairmap);\n'> <' $j = JSON::PP->new->allow_nonref;\n'> <' print "{", join(",", pairmap { $j->encode($a) .":". $b } @ARGV), "}"\n'> <' '> ) } {(DQ ($ Id.VSub_At '@'))} ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <json-arr> name: json-arr body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <perl> more_env: [] words: [ {<perl>} {<-e>} {(SQ <'\n'> <' print "[", join(",", @ARGV), "]"\n'> <' '>)} {(DQ ($ Id.VSub_At '@'))} ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <json-str> name: json-str body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <perl> more_env: [] words: [ {<perl>} {<-mJSON> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <PP>} {<-e>} {(SQ <'print JSON::PP->new->allow_nonref->encode($ARGV[0])'>)} {(DQ ($ Id.VSub_Number 1))} ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <json-get> name: json-get body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <perl> more_env: [] words: [ {<perl>} {<-mJSON> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <PP>} {<-e>} { (SQ <'\n'> <' local $/; my $s = <STDIN> || exit 1;\n'> <' my $j = JSON::PP->new->allow_nonref;\n'> <' my $data = $j->decode($s);\n'> <' my $x = $data;\n'> <' foreach (@ARGV) {\n'> <' if (ref($x) eq "ARRAY") {\n'> <' # convert array to k=>v hash\n'> <' my %h = map { $_ => $x->[$_] } 0..$#$x;\n'> <' $x = \\%h;\n'> <' }\n'> <' exists $x->{$_} or die "invalid JSON index";\n'> <' $x = $x->{$_};\n'> <' }\n'> <' print $j->encode($x), "\\n";\n'> <' '> ) } {(DQ ($ Id.VSub_At '@'))} ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <json-raw> name: json-raw body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <perl> more_env: [] words: [ {<perl>} {<-mJSON> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <PP>} {<-e>} { (SQ <'\n'> <' local $/; my $s = <STDIN> || exit 1;\n'> <' my $j = JSON::PP->new->allow_nonref;\n'> <' sub flat {\n'> <' my $x = shift;\n'> <' if (ref($x) eq "ARRAY") {\n'> <' flat($_) foreach @$x;\n'> <' } elsif (ref($x) eq "HASH") {\n'> <' flat($_) foreach values %$x;\n'> <' } else {\n'> <' print $x, "\\n";\n'> <' }\n'> <' }\n'> <' flat $j->decode($s);\n'> <' '> ) } ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <json-raw-nonnull> name: json-raw-nonnull body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<x>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_VarLike 'x='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'x='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'x='> name:x) op: assign_op.Equal rhs: { (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <cat> more_env: [] words: [{<cat>}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) } ) ] redirects: [] ) (command.Case case_kw: <Id.KW_Case case> to_match: (case_arg.Word w:{($ Id.VSub_DollarName x)}) arms_start: <Id.KW_In in> arms: [ (CaseArm left: <null> pattern: (pat.Words words:[{<null>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <false> more_env: [] words: [{<false>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <Id.Lit_Star '*'> pattern: (pat.Words words:[{<Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <json-raw> more_env: [] words: [{<json-raw>}] redirects: [ (Redir op: <Id.Redir_TLess '<<<'> loc: (redir_loc.Fd fd:0) arg: {(DQ ($ Id.VSub_DollarName x))} ) ] do_fork: T ) ] right: <Id.Op_DSemi _> ) ] arms_end: <Id.KW_Esac esac> redirects: [] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <json-get-raw> name: json-get-raw body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple blame_tok: <json-get> more_env: [] words: [{<json-get>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <json-raw> more_env: [] words: [{<json-raw>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <json-get-raw-nonnull> name: json-get-raw-nonnull body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple blame_tok: <json-get> more_env: [] words: [{<json-get>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <json-raw-nonnull> more_env: [] words: [{<json-raw-nonnull>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <decode-base64> name: decode-base64 body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <perl> more_env: [] words: [ {<perl>} {<-MMIME> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <Base64>} {<-e>} {(SQ <'print decode_base64(<STDIN>)'>)} ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <hush> name: hush body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <Id.Left_DoubleQuote '"'> more_env: [] words: [{(DQ ($ Id.VSub_At '@'))}] redirects: [ (Redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) ] do_fork: T ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-post> name: wd-post body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_eq left: {($ Id.VSub_Pound '#')} right: {<2>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <curl> more_env: [] words: [ {<curl>} {<-sSL>} {<-H>} {(DQ <'Content-Type: application/json'>)} {<--data-raw>} {(DQ ($ Id.VSub_Number 2))} {(DQ ($ Id.VSub_DollarName WEBDRIVER_URL)) (DQ ($ Id.VSub_Number 1))} ] redirects: [] do_fork: T ) ] spids: [1077 1090] ) (IfArm keyword: <Id.KW_Elif elif> cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_eq left: {($ Id.VSub_Pound '#')} right: {<1>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <curl> more_env: [] words: [ {<curl>} {<-sSL>} {<-XPOST>} {(DQ ($ Id.VSub_DollarName WEBDRIVER_URL)) (DQ ($ Id.VSub_Number 1))} ] redirects: [] do_fork: T ) ] spids: [1119 1132] ) ] else_kw: <Id.KW_Else else> else_action: [ (command.Simple blame_tok: <die> more_env: [] words: [{<die>} {<127>} {<internal>} {<error>}] redirects: [] do_fork: T ) ] fi_kw: <Id.KW_Fi fi> redirects: [] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-new-session> name: wd-new-session body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<capabilities>}] redirects: [] do_fork: T ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: {(DQ ($ Id.VSub_DollarName WEBDRIVER_CAPABILITIES))} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.ShAssignment left: <Id.Lit_VarLike 'capabilities='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'capabilities='> lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'capabilities='> name: capabilities ) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName WEBDRIVER_CAPABILITIES))} ) ] redirects: [] ) ] spids: [1178 1191] ) (IfArm keyword: <Id.KW_Elif elif> cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: {(DQ ($ Id.VSub_DollarName WEBDRIVER_BROWSER))} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.ShAssignment left: <Id.Lit_VarLike 'capabilities='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'capabilities='> lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'capabilities='> name: capabilities ) op: assign_op.Equal rhs: { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-obj> more_env: [] words: [ {<json-obj>} {<browserName>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-str> more_env: [] words: [ {<json-str>} {(DQ ($ Id.VSub_DollarName WEBDRIVER_BROWSER))} ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ) ] redirects: [] ) ] spids: [1200 1213] ) ] else_kw: <Id.KW_Else else> else_action: [ (command.Simple blame_tok: <die> more_env: [] words: [ {<die>} {<1>} {(DQ <'neither WEBDRIVER_CAPABILITIES nor WEBDRIVER_BROWSER set'>)} ] redirects: [] do_fork: T ) ] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.Pipeline children: [ (command.Simple blame_tok: <wd-post> more_env: [] words: [ {<wd-post>} {<'/session'>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-obj> more_env: [] words: [ {<json-obj>} {<desiredCapabilities>} {(DQ ($ Id.VSub_DollarName capabilities))} ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) (command.Simple blame_tok: <json-get-raw-nonnull> more_env: [] words: [{<json-get-raw-nonnull>} {<sessionId>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-assert-session> name: wd-assert-session body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Unary op_id: Id.BoolUnary_z child: {(DQ ($ Id.VSub_DollarName WEBDRIVER_SESSION))} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <die> more_env: [] words: [{<die>} {<1>} {<WEBDRIVER_SESSION>} {<not>} {<defined>}] redirects: [] do_fork: T ) ] spids: [1284 1297] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-session> name: wd-get-session body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <wd-assert-session> more_env: [] words: [{<wd-assert-session>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <curl> more_env: [] words: [ {<curl>} {<-sSL>} {(DQ ($ Id.VSub_DollarName WEBDRIVER_URL)) <'/session/'> (DQ ($ Id.VSub_DollarName WEBDRIVER_SESSION)) (DQ ($ Id.VSub_Number 1)) } ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-checked-result> name: wd-checked-result body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<result>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_VarLike 'result='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'result='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'result='> name:result) op: assign_op.Equal rhs: { (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <cat> more_env: [] words: [{<cat>}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) } ) ] redirects: [] ) (command.ShAssignment left: <Id.Lit_VarLike 'status='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'status='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'status='> name:status) op: assign_op.Equal rhs: { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-get> more_env: [] words: [{<json-get>} {<status>}] redirects: [ (Redir op: <Id.Redir_TLess '<<<'> loc: (redir_loc.Fd fd:0) arg: {(DQ ($ Id.VSub_DollarName result))} ) ] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ) ] redirects: [] ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_ne left: {($ Id.VSub_DollarName status)} right: {<0>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <die> more_env: [] words: [ {<die>} {<1>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-get-raw> more_env: [] words: [{<json-get-raw>} {<value>} {<message>}] redirects: [ (Redir op: <Id.Redir_TLess '<<<'> loc: (redir_loc.Fd fd:0) arg: {(DQ ($ Id.VSub_DollarName result))} ) ] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) ] spids: [1377 1390] ) ] else_kw: <Id.KW_Else else> else_action: [ (command.Simple blame_tok: <json-get> more_env: [] words: [{<json-get>} {<value>}] redirects: [ (Redir op: <Id.Redir_TLess '<<<'> loc: (redir_loc.Fd fd:0) arg: {(DQ ($ Id.VSub_DollarName result))} ) ] do_fork: T ) ] fi_kw: <Id.KW_Fi fi> redirects: [] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-post-session-value> name: wd-post-session-value body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple blame_tok: <wd-post-session> more_env: [] words: [{<wd-post-session>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <wd-checked-result> more_env: [] words: [{<wd-checked-result>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-session-simple> name: wd-get-session-simple body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple blame_tok: <wd-get-session> more_env: [] words: [{<wd-get-session>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <json-get-raw-nonnull> more_env: [] words: [{<json-get-raw-nonnull>} {<value>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-session-value> name: wd-get-session-value body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple blame_tok: <wd-get-session> more_env: [] words: [{<wd-get-session>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <wd-checked-result> more_env: [] words: [{<wd-checked-result>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-session-value-raw> name: wd-get-session-value-raw body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple blame_tok: <wd-get-session-value> more_env: [] words: [{<wd-get-session-value>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <json-raw-nonnull> more_env: [] words: [{<json-raw-nonnull>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-element-value> name: wd-get-element-value body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <wd-get-session-value-raw> more_env: [] words: [ {<wd-get-session-value-raw>} {<'/element/'> (DQ ($ Id.VSub_Number 1)) <'/'> (DQ ($ Id.VSub_Number 2))} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-current-url> name: wd-get-current-url body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <wd-get-session-simple> more_env: [] words: [{<wd-get-session-simple>} {<'/url'>}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-title> name: wd-get-title body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <wd-get-session-simple> more_env: [] words: [{<wd-get-session-simple>} {<'/title'>}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-window-handle> name: wd-get-window-handle body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <wd-get-session-simple> more_env: [] words: [{<wd-get-session-simple>} {<'/window'>}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-page-source> name: wd-get-page-source body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple blame_tok: <wd-get-session-value> more_env: [] words: [{<wd-get-session-value>} {<'/source'>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <json-raw> more_env: [] words: [{<json-raw>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-delete-session> name: wd-delete-session body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <wd-assert-session> more_env: [] words: [{<wd-assert-session>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <curl> more_env: [] words: [ {<curl>} {<-sSL>} {<-XDELETE>} {(DQ ($ Id.VSub_DollarName WEBDRIVER_URL)) <'/session/'> (DQ ($ Id.VSub_DollarName WEBDRIVER_SESSION)) (DQ ($ Id.VSub_Number 1)) } ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-post-session> name: wd-post-session body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <wd-assert-session> more_env: [] words: [{<wd-assert-session>}] redirects: [] do_fork: T ) (command.Sentence child: (command.ShAssignment left: <Id.Lit_VarLike 'url='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'url='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'url='> name:url) op: assign_op.Equal rhs: {($ Id.VSub_Number 1)} ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.Pipeline children: [ (command.Simple blame_tok: <wd-post> more_env: [] words: [ {<wd-post>} {<'/session/'> (DQ ($ Id.VSub_DollarName WEBDRIVER_SESSION)) (DQ ($ Id.VSub_DollarName url)) } {(DQ ($ Id.VSub_At '@'))} ] redirects: [] do_fork: T ) (command.Simple blame_tok: <wd-checked-result> more_env: [] words: [{<wd-checked-result>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-go> name: wd-go body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <hush> more_env: [] words: [ {<hush>} {<wd-post-session>} {<'/url'>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-obj> more_env: [] words: [ {<json-obj>} {<url>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-str> more_env: [] words: [{<json-str>} {(DQ ($ Id.VSub_Number 1))}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-close-window> name: wd-close-window body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <hush> more_env: [] words: [{<hush>} {<wd-delete-session>} {<'/window'>}] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-switch-to-window> name: wd-switch-to-window body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <hush> more_env: [] words: [ {<hush>} {<wd-post-session>} {<'/window'>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-obj> more_env: [] words: [ {<json-obj>} {<handle>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-str> more_env: [] words: [{<json-str>} {(DQ ($ Id.VSub_Number 1))}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-window-handles> name: wd-get-window-handles body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Pipeline children: [ (command.Simple blame_tok: <wd-get-session> more_env: [] words: [{<wd-get-session>} {<'/window/handles'>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <json-get-raw> more_env: [] words: [{<json-get-raw>} {<value>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-switch-to-frame> name: wd-switch-to-frame body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<id>}] redirects: [] do_fork: T ) (command.Case case_kw: <Id.KW_Case case> to_match: (case_arg.Word w:{($ Id.VSub_Number 1)}) arms_start: <Id.KW_In in> arms: [ (CaseArm left: <Id.Lit_LBracket '['> pattern: (pat.Words words:[{<Id.Lit_LBracket '['> <0-9> <Id.Lit_RBracket ']'>}]) middle: <Id.Right_CasePat _> action: [ (command.ShAssignment left: <Id.Lit_VarLike 'id='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'id='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'id='> name:id) op: assign_op.Equal rhs: {($ Id.VSub_Number 1)} ) ] redirects: [] ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <Id.Lit_Star '*'> pattern: (pat.Words words:[{<Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.ShAssignment left: <Id.Lit_VarLike 'id='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'id='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'id='> name:id) op: assign_op.Equal rhs: { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-str> more_env: [] words: [{<json-str>} {(DQ ($ Id.VSub_Number 1))}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ) ] redirects: [] ) ] right: <Id.Op_DSemi _> ) ] arms_end: <Id.KW_Esac esac> redirects: [] ) (command.Simple blame_tok: <hush> more_env: [] words: [ {<hush>} {<wd-post-session>} {<'/frame'>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-obj> more_env: [] words: [{<json-obj>} {<id>} {(DQ ($ Id.VSub_DollarName id))}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-switch-to-top-level-frame> name: wd-switch-to-top-level-frame body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <hush> more_env: [] words: [ {<hush>} {<wd-post-session>} {<frame>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-obj> more_env: [] words: [{<json-obj>} {<id>} {<null>}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-window-size> name: wd-get-window-size body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<result>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_VarLike 'result='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'result='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'result='> name:result) op: assign_op.Equal rhs: { (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <wd-get-session> more_env: [] words: [{<wd-get-session>} {<'/window/size'>}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) } ) ] redirects: [] ) (command.Pipeline children: [ (command.Simple blame_tok: <echo> more_env: [] words: [{<echo>} {(DQ ($ Id.VSub_DollarName result))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <json-get-raw> more_env: [] words: [{<json-get-raw>} {<value>} {<width>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) (command.Pipeline children: [ (command.Simple blame_tok: <echo> more_env: [] words: [{<echo>} {(DQ ($ Id.VSub_DollarName result))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <json-get-raw> more_env: [] words: [{<json-get-raw>} {<value>} {<height>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-set-window-size> name: wd-set-window-size body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <hush> more_env: [] words: [ {<hush>} {<wd-post-session>} {<'/window/size'>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-obj> more_env: [] words: [ {<json-obj>} {<width>} {(DQ ($ Id.VSub_Number 1))} {<height>} {(DQ ($ Id.VSub_Number 2))} ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-maximize> name: wd-maximize body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <hush> more_env: [] words: [{<hush>} {<wd-post-session>} {<'/window/maximize'>}] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-parse-strategy> name: wd-parse-strategy body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Case case_kw: <Id.KW_Case case> to_match: (case_arg.Word w:{($ Id.VSub_Number 1)}) arms_start: <Id.KW_In in> arms: [ (CaseArm left: <id> pattern: (pat.Words words:[{<id>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <json-str> more_env: [] words: [{<json-str>} {(DQ <id>)}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <name> pattern: (pat.Words words:[{<name>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <json-str> more_env: [] words: [{<json-str>} {(DQ <name>)}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <Id.KW_Class class> pattern: (pat.Words words:[{<Id.KW_Class class> <Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <json-str> more_env: [] words: [{<json-str>} {(DQ <'class name'>)}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <tag> pattern: (pat.Words words:[{<tag> <Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <json-str> more_env: [] words: [{<json-str>} {(DQ <'tag name'>)}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <css> pattern: (pat.Words words:[{<css> <Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <json-str> more_env: [] words: [{<json-str>} {(DQ <'css selector'>)}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <link> pattern: (pat.Words words:[{<link> <Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <json-str> more_env: [] words: [{<json-str>} {(DQ <'link text'>)}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <partial> pattern: (pat.Words words:[{<partial> <Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <json-str> more_env: [] words: [{<json-str>} {(DQ <'partial link text'>)}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <xpath> pattern: (pat.Words words:[{<xpath> <Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <json-str> more_env: [] words: [{<json-str>} {<xpath>}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <Id.Lit_Star '*'> pattern: (pat.Words words:[{<Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <die> more_env: [] words: [ {<die>} {<1>} {<unknown>} {<element>} {<location>} {<strategy> <Id.Lit_Colon ':'>} {(DQ ($ Id.VSub_Number 1))} ] redirects: [] do_fork: T ) ] ) ] arms_end: <Id.KW_Esac esac> redirects: [] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-general-element-find> name: wd-general-element-find body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<Id.Lit_VarLike 'path='> (DQ ($ Id.VSub_Number 1))}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<strategy>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_VarLike 'strategy='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'strategy='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'strategy='> name:strategy) op: assign_op.Equal rhs: { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <wd-parse-strategy> more_env: [] words: [{<wd-parse-strategy>} {(DQ ($ Id.VSub_Number 1))}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ) ] redirects: [] ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_eq left: {($ Id.VSub_QMark '?')} right: {<0>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.ControlFlow keyword: <Id.ControlFlow_Exit exit> arg_word: {($ Id.VSub_QMark '?')} ) ] ops: [<Id.Op_DPipe _>] ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<value>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_VarLike 'value='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'value='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'value='> name:value) op: assign_op.Equal rhs: { (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-str> more_env: [] words: [{<json-str>} {(DQ ($ Id.VSub_Star '*'))}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) } ) ] redirects: [] ) (command.Pipeline children: [ (command.Simple blame_tok: <wd-post-session> more_env: [] words: [ {<wd-post-session>} {(DQ ($ Id.VSub_DollarName path))} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-obj> more_env: [] words: [ {<json-obj>} {<using>} {(DQ ($ Id.VSub_DollarName strategy))} {<value>} {(DQ ($ Id.VSub_DollarName value))} ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) (command.Simple blame_tok: <json-raw> more_env: [] words: [{<json-raw>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-find-element> name: wd-find-element body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <wd-general-element-find> more_env: [] words: [{<wd-general-element-find>} {<'/element'>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-find-elements> name: wd-find-elements body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <wd-general-element-find> more_env: [] words: [{<wd-general-element-find>} {<'/elements'>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-find-element-from-element> name: wd-find-element-from-element body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<Id.Lit_VarLike 'element='> ($ Id.VSub_Number 1)}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <wd-general-element-find> more_env: [] words: [ {<wd-general-element-find>} {<'/element/'> (DQ ($ Id.VSub_DollarName element)) <'/element'>} {(DQ ($ Id.VSub_At '@'))} ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-find-elements-from-element> name: wd-find-elements-from-element body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<Id.Lit_VarLike 'element='> ($ Id.VSub_Number 1)}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <wd-general-element-find> more_env: [] words: [ {<wd-general-element-find>} {<'/element/'> (DQ ($ Id.VSub_DollarName element)) <'/elements'>} {(DQ ($ Id.VSub_At '@'))} ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-element-attribute> name: wd-get-element-attribute body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<x>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_VarLike 'x='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'x='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'x='> name:x) op: assign_op.Equal rhs: { (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <wd-get-session-value-raw> more_env: [] words: [ {<wd-get-session-value-raw>} {<'/element/'> (DQ ($ Id.VSub_Number 1)) <'/attribute/'> (DQ ($ Id.VSub_Number 2)) } ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) } ) ] redirects: [] ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_eq left: {($ Id.VSub_QMark '?')} right: {<0>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <die> more_env: [] words: [{<die>} {<1>} {(DQ <'attribute not found'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.Simple blame_tok: <echo> more_env: [] words: [{<echo>} {(DQ ($ Id.VSub_DollarName x))}] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-element-css-value> name: wd-get-element-css-value body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<x>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_VarLike 'x='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'x='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'x='> name:x) op: assign_op.Equal rhs: { (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <wd-get-session-value-raw> more_env: [] words: [ {<wd-get-session-value-raw>} {<'/element/'> (DQ ($ Id.VSub_Number 1)) <'/css/'> (DQ ($ Id.VSub_Number 2)) } ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) } ) ] redirects: [] ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_eq left: {($ Id.VSub_QMark '?')} right: {<0>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <die> more_env: [] words: [{<die>} {<1>} {(DQ <'CSS property not found'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.Simple blame_tok: <echo> more_env: [] words: [{<echo>} {(DQ ($ Id.VSub_DollarName x))}] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-element-text> name: wd-get-element-text body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <wd-get-element-value> more_env: [] words: [{<wd-get-element-value>} {(DQ ($ Id.VSub_Number 1))} {<text>}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-element-tag-name> name: wd-get-element-tag-name body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <wd-get-element-value> more_env: [] words: [{<wd-get-element-value>} {(DQ ($ Id.VSub_Number 1))} {<name>}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-is-element-enabled> name: wd-is-element-enabled body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_eq left: {<1>} right: { (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <wd-get-element-value> more_env: [] words: [{<wd-get-element-value>} {(DQ ($ Id.VSub_Number 1))} {<enabled>}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) } ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-is-element-selected> name: wd-is-element-selected body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_eq left: {<1>} right: { (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <wd-get-element-value> more_env: [] words: [ {<wd-get-element-value>} {(DQ ($ Id.VSub_Number 1))} {<selected>} ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) } ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-element-simple-action> name: wd-element-simple-action body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <hush> more_env: [] words: [ {<hush>} {<wd-post-session>} {<'/element/'> (DQ ($ Id.VSub_Number 1)) <'/'> (DQ ($ Id.VSub_Number 2))} ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-element-click> name: wd-element-click body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <wd-element-simple-action> more_env: [] words: [{<wd-element-simple-action>} {(DQ ($ Id.VSub_Number 1))} {<click>}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-element-clear> name: wd-element-clear body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <wd-element-simple-action> more_env: [] words: [{<wd-element-simple-action>} {(DQ ($ Id.VSub_Number 1))} {<clear>}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-element-send-keys> name: wd-element-send-keys body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<element>}] redirects: [] do_fork: T ) (command.Sentence child: (command.ShAssignment left: <Id.Lit_VarLike 'element='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'element='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'element='> name:element) op: assign_op.Equal rhs: {($ Id.VSub_Number 1)} ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <wd-element-simple-action> more_env: [] words: [ {<wd-element-simple-action>} {(DQ ($ Id.VSub_DollarName element))} {<value>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-obj> more_env: [] words: [ {<json-obj>} {<value>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-str> more_env: [] words: [{<json-str>} {(DQ ($ Id.VSub_Star '*'))}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-execute-script-sync> name: wd-execute-script-sync body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<Id.Lit_VarLike 'script='> (DQ ($ Id.VSub_Number 1))}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <wd-post-session> more_env: [] words: [ {<wd-post-session>} {<'/execute/sync'>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-obj> more_env: [] words: [ {<json-obj>} {<script>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-str> more_env: [] words: [{<json-str>} {(DQ ($ Id.VSub_DollarName script))}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } {<args>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-arr> more_env: [] words: [{<json-arr>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-execute-script-async> name: wd-execute-script-async body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<Id.Lit_VarLike 'script='> (DQ ($ Id.VSub_Number 1))}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <wd-post-session> more_env: [] words: [ {<wd-post-session>} {<'/execute/async'>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-obj> more_env: [] words: [ {<json-obj>} {<script>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-str> more_env: [] words: [{<json-str>} {(DQ ($ Id.VSub_DollarName script))}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } {<args>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-arr> more_env: [] words: [{<json-arr>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-all-cookies> name: wd-get-all-cookies body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <wd-get-session-value> more_env: [] words: [{<wd-get-session-value>} {<'/cookie'>}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-get-named-cookie> name: wd-get-named-cookie body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <wd-get-session-value> more_env: [] words: [{<wd-get-session-value>} {<'/cookie/'> (DQ ($ Id.VSub_Number 1))}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-add-cookie> name: wd-add-cookie body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <hush> more_env: [] words: [ {<hush>} {<wd-post-session>} {<'/cookie'>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-obj> more_env: [] words: [ {<json-obj>} {<cookie>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <json-obj> more_env: [] words: [{<json-obj>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-delete-cookie> name: wd-delete-cookie body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <wd-delete-session> more_env: [] words: [{<wd-delete-session>} {<'/cookie/'> (DQ ($ Id.VSub_Number 1))}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-delete-cookies> name: wd-delete-cookies body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <wd-delete-session> more_env: [] words: [{<wd-delete-session>} {<'/cookie'>}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-take-screenshot> name: wd-take-screenshot body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Pipeline children: [ (command.Simple blame_tok: <wd-get-session-value> more_env: [] words: [{<wd-get-session-value>} {<'/screenshot'>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <json-raw> more_env: [] words: [{<json-raw>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <decode-base64> more_env: [] words: [{<decode-base64>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _> <Id.Op_Pipe _>] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <wd-take-element-screenshot> name: wd-take-element-screenshot body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Pipeline children: [ (command.Simple blame_tok: <wd-get-session-value> more_env: [] words: [ {<wd-get-session-value>} {<'/element/'> (DQ ($ Id.VSub_Number 1)) <'/screenshot'>} ] redirects: [] do_fork: T ) (command.Simple blame_tok: <json-raw> more_env: [] words: [{<json-raw>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <decode-base64> more_env: [] words: [{<decode-base64>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _> <Id.Op_Pipe _>] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <print-help> name: print-help body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <cat> more_env: [] words: [{<cat>}] redirects: [ (Redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(SQ <.>)} here_end_tok: <Id.Undefined_Tok ''> stdin_parts: [ <'# wd -- WebDriver command line tool\n'> <'\n'> <'`wd` is a simple tool for interacting with servers that implement the\n'> <'W3C WebDriver API.\n'> <'\n'> <'It can be used for web automation tasks such as testing and scraping.\n'> <'\n'> < 'You can use [Selenium](http://www.seleniumhq.org/) as the WebDriver server\n' > <'to control browsers on your own machine.\n'> <'\n'> < 'There are commercial services that offer the WebDriver API remotely; see\n' > < '"Functional Test Services" [here](http://www.seleniumhq.org/ecosystem/).\n' > <'\n'> < 'See [the WebDriver spec](https://w3c.github.io/webdriver/webdriver-spec.html)\n' > <'for details about the protocol and behavior.\n'> <'\n'> <'## Dependencies\n'> <'\n'> <' - `bash`\n'> <' - `perl` (5.14 or greater)\n'> <' - `curl`\n'> <'\n'> <'## Example session\n'> <'\n'> <' $ export WEBDRIVER_BROWSER=chrome\n'> <' $ export WEBDRIVER_SESSION="$(wd new-session)"\n'> <' $ wd go https://github.com/mbrock/wd\n'> <' $ wd screenshot > /tmp/wd.png\n'> <' $ wd click "$(wd find css .user-mention)"\n'> <' $ wd exec \'return document.title\'\n'> <'\n'> <'## Configuration\n'> <'\n'> < ' - `WEBDRIVER_URL`: WebDriver API URL (default `http://127.0.0.1:4444/wd/hub`)\n' > <'\n'> <'## Command reference\n'> <'\n'> <'### Managing sessions\n'> <'\n'> <'#### `wd new-session`\n'> <'\n'> <'Prints the new session ID.\n'> <'\n'> <'All other commands expect this ID to be in `WEBDRIVER_SESSION`, so\n'> <'\n'> <' export WEBDRIVER_SESSION="$(wd new-session)"\n'> <'\n'> <'is a useful pattern.\n'> <'\n'> <'You must configure desired capabilities by setting either\n'> <'\n'> <' - `WEBDRIVER_CAPABILITIES` to a stringified JSON object, or\n'> <' - `WEBDRIVER_BROWSER` to a browser name (`chrome`, `firefox`, etc).\n'> <'\n'> <'#### `wd delete-session`\n'> <'\n'> <'Deletes the current session.\n'> <'\n'> <'### Navigation\n'> <'\n'> <'#### `wd go <url>`\n'> <'\n'> <'Opens `<url>` in the current window.\n'> <'\n'> <'#### `wd back`\n'> <'\n'> <'Navigates back in the current window.\n'> <'\n'> <'#### `wd forward`\n'> <'\n'> <'Navigates forward in the current window.\n'> <'\n'> <'#### `wd refresh`\n'> <'\n'> <'Refreshes the page of the current window.\n'> <'\n'> <'### Element finding\n'> <'\n'> <'#### `wd find <strategy> <selector> ...`\n'> <'\n'> <'Finds one matching element and prints its element ID.\n'> <'\n'> <'The `<strategy>` can be one of:\n'> <'\n'> <' - `css` (CSS selector)\n'> <' - `xpath` (XPath selector)\n'> <' - `id` (element ID)\n'> <' - `name` (element name)\n'> <' - `class` (element class name)\n'> <' - `tag` (element tag name)\n'> <' - `link` (element link text)\n'> <' - `partial` (partial element link text)\n'> <'\n'> <'The `<selector>` values are concatenated for convenience.\n'> <'\n'> <'Example:\n'> <'\n'> <' $ wd find css article header img.avatar\n'> <'\n'> <'#### `wd find-all <strategy> <selector> ...`\n'> <'\n'> <'See `wd find`; finds all matching elements.\n'> <'\n'> <'#### `wd find-in <element-id> <strategy> <selector> ...`\n'> <'\n'> <'See `wd find`; finds one matching sub-element.\n'> <'\n'> <'#### `wd find-all-in <element-id> <strategy> <selector> ...`\n'> <'\n'> <'See `wd find`; finds all matching sub-elements.\n'> <'\n'> <'### Element information\n'> <'\n'> <'#### `wd is-selected <element-id>`\n'> <'\n'> <'Exits with a non-zero status if the element is not a selected or\n'> <'checked `input` or `option`.\n'> <'\n'> <'#### `wd is-enabled <element-id>`\n'> <'\n'> <'Exits with a non-zero status if the element is not an enabled\n'> <'form control.\n'> <'\n'> <'#### `wd attribute <element-id> <attribute-name>`\n'> <'\n'> <'Prints an element attribute value.\n'> <'\n'> <'Exits with non-zero status if the given attribute does not exist.\n'> <'\n'> <'#### `wd css-value <element-id> <css-property-name>`\n'> <'\n'> <'Prints an element CSS property value.\n'> <'\n'> <'Exits with non-zero status if the given style property does not exist.\n'> <'\n'> <'#### `wd text <element-id>`\n'> <'\n'> <'Prints an element\'s `innerText`.\n'> <'\n'> <'#### `wd tag-name <element-id>`\n'> <'\n'> <'Prints the tag name of an element.\n'> <'\n'> <'### Element actions\n'> <'\n'> <'#### `wd click <element-id>`\n'> <'\n'> <'Clicks an element.\n'> <'\n'> <'#### `wd clear <element-id>`\n'> <'\n'> <'Clears the value, checkedness, or text content of an element.\n'> <'\n'> <'#### `wd send-keys <element-id> [keys] ...`\n'> <'\n'> <'Sends keys to an element.\n'> <'\n'> <'Key arguments are concatenated for convenience.\n'> <'\n'> <'Example:\n'> <'\n'> <' $ wd send-keys "$(wd find id search)" webdriver json api\n'> <'\n'> <'### JavaScript execution\n'> <'\n'> <'#### `wd execute <body> [argument] ...`\n'> <'\n'> <'Evaluates the JavaScript code `<body>` as a function called with the\n'> <'given arguments.\n'> <'\n'> <'Prints the return value of the specified function.\n'> <'\n'> <'#### `wd execute-async <body> [argument] ...`\n'> <'\n'> < 'Evaluates as in `wd execute` but waiting for the script to invoke a callback\n' > < 'which is passed as an additional final argument to the specified function.\n' > <'\n'> <'Prints the value finally passed to the callback.\n'> <'\n'> <'### Page information\n'> <'\n'> <'#### `wd get-current-url`\n'> <'\n'> <'Prints the URL of the page in the current window.\n'> <'\n'> <'#### `wd get-title`\n'> <'\n'> <'Prints the title of the page in the current window.\n'> <'\n'> <'#### `wd get-page-source`\n'> <'\n'> <'Prints the raw HTML source of the page in the current window.\n'> <'\n'> <'### Windows\n'> <'\n'> <'#### `wd get-window-size`\n'> <'\n'> <'Prints the current window\'s width and height on separate lines.\n'> <'\n'> <'#### `wd set-window-size <width> <height>`\n'> <'\n'> <'Changes the size of the current window.\n'> <'\n'> <'#### `wd maximize`\n'> <'\n'> <'Maximizes the current window.\n'> <'\n'> <'#### `wd get-window-handle`\n'> <'\n'> <'Prints the window handle of the current window.\n'> <'\n'> <'#### `wd get-window-handles`\n'> <'\n'> <'Prints a list of all window handles in the current session.\n'> <'\n'> <'#### `wd switch-to-window <window-handle>`\n'> <'\n'> <'Changes which window is the current window.\n'> <'\n'> <'### Frames\n'> <'\n'> <'#### `wd switch-to-frame <frame-id>`\n'> <'\n'> <'Changes the current frame.\n'> <'\n'> <'`<frame-id>` can be either a number or an element ID.\n'> <'\n'> < 'See [the specification](https://www.w3.org/TR/webdriver/#switch-to-frame)\n' > <'for exact details.\n'> <'\n'> <'#### `wd switch-to-top-level-frame`\n'> <'\n'> <'Resets the current frame to the top level.\n'> <'\n'> <'#### `wd switch-to-parent-frame`\n'> <'\n'> <'Sets the current frame to the parent of the current frame.\n'> <'\n'> <'### Cookies\n'> <'\n'> < 'See [the spec](https://w3c.github.io/webdriver/webdriver-spec.html#cookies)\n' > <'for details on cookie JSON serialization.\n'> <'\n'> <'#### `wd cookies`\n'> <'\n'> <'Prints the currently set cookies as a JSON array.\n'> <'\n'> <'#### `wd cookie <name>`\n'> <'\n'> <'Prints the cookie named `<name>` as JSON.\n'> <'\n'> <'#### `wd add-cookie <key> <value> <key> <value> ...`\n'> <'\n'> <'Adds a cookie according to the given keys/values.\n'> <'\n'> <'Example: `wd add-cookie name \'"user"\' value \'"mbrock"\'`\n'> <'\n'> <'#### `wd delete-cookie <name>`\n'> <'\n'> <'Deletes the cookie whose name is `<name>`.\n'> <'\n'> <'#### `wd delete-cookies`\n'> <'\n'> <'Deletes all cookies.\n'> <'\n'> <'### Screenshots\n'> <'\n'> <'#### `wd screenshot`\n'> <'\n'> <'Prints a binary PNG screenshot to stdout.\n'> <'\n'> <'#### `wd element-screenshot <element-id>`\n'> <'\n'> <'Prints a binary PNG screenshot of a specific element to stdout.\n'> <'\n'> <'(Not supported by Chrome.)\n'> ] ) ) ] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.Simple blame_tok: <main> more_env: [] words: [{<main>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] )