Skip to content

Commit

Permalink
Added "ClearInput"-Method and documented it
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaas2 committed Dec 16, 2020
1 parent 2336263 commit b41e02a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Binary file modified DocSrc/Selenium from Dyalog New.docx
Binary file not shown.
13 changes: 10 additions & 3 deletions Selenium.dyalog
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
:If 0=⎕NC'SETTINGS' ApplySettings settings :EndIf
:EndIf
browserSETTINGS.BROWSER
filesbrowser SetUsing (pathDLLPATH)SETTINGS.Newtonpath
filesbrowser SetUsing(pathDLLPATH)SETTINGS.Newtonpath
'CURRENTBROWSER'DefaultTo'' Avoid VALUE ERRORs
⎕EX'BROWSER'/browserCURRENTBROWSER We want to switch or need a new one
:Trap 0 Try to find out if Browser is alive - not always reliable
Expand Down Expand Up @@ -159,6 +159,7 @@
msg,'blocked (Properties>General>Unblock)',⎕UCS 13
msg,'Or maybe something else is wrong. Here are the details of the exception:',⎕UCS 13
msg,⎕EXCEPTION.Message
:If options'' msg,(⎕UCS 13 13),'options:',options :EndIf
msg ⎕SIGNAL 19
:Else
(msg,'missing')⎕SIGNAL 22
Expand Down Expand Up @@ -263,6 +264,12 @@
:EndSection ───────────────────────────────────────────────────────────────────────────────────

:Section COVER FUNCTIONS
ClearInput obj;q
:If 0qFind obj
q.Clear
:EndIf

{ok}obj SendKeys text;q;i;k
Send keystrokes - see Keys.⎕NL -2 for special keys like Keys.Enter
Note that even 'A' Control 'X' will be interpreted as Ctrl+A,X
Expand Down Expand Up @@ -656,7 +663,7 @@

{files}browser SetUsing path;net ⍝ S)SETTINGS:Newtonpathet the path to the Selenium DLLs
(path Newtonpath)path
(path Newtonpath)path
:If path'' pathSourcePath ⎕THIS
:Else pathpath,(~'/\'/path)/'/' :EndIf
⎕USING0⎕USING
Expand All @@ -672,7 +679,7 @@
⎕USING,'OpenQA.Selenium,',files
⎕USING,'OpenQA.Selenium.',browser,',',files
⎕USING,'OpenQA.Selenium.Support,',files
⎕USING,'Newtonsoft.Json,',(11⎕nparts ¯1path),Newtonpath,net,'Newtonsoft.Json.dll'
⎕USING,'Newtonsoft.Json,',(11 ⎕NPARTS ¯1path),Newtonpath,net,'Newtonsoft.Json.dll'
make sure we use the correct path-separator (⎕USING)
:If 'W'=11'.'⎕WG'APLVersion'
⎕USING{'\'@('/'=)}¨⎕USING
Expand Down

0 comments on commit b41e02a

Please sign in to comment.