Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
74e81194
...
74e8119415a186f2d7e9a90ec4ed467697beeafc
authored
2011-11-08 15:20:01 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
closes #5 - added input field focus() and blur() event support to form filling
1 parent
0c2c4666
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
casper.js
casper.js
View file @
74e8119
...
...
@@ -1005,6 +1005,11 @@
this
.
log
(
"invalid field type; only HTMLElement and NodeList are supported"
,
"error"
);
}
this
.
log
(
'set "'
+
field
.
getAttribute
(
'name'
)
+
'" field value to '
+
value
,
"debug"
);
try
{
field
.
focus
();
}
catch
(
e
)
{
__utils__
.
log
(
"Unable to focus() input field "
+
field
.
getAttribute
(
'name'
)
+
": "
+
e
,
"warning"
);
}
var
nodeName
=
field
.
nodeName
.
toLowerCase
();
switch
(
nodeName
)
{
case
"input"
:
...
...
@@ -1059,6 +1064,11 @@
out
=
'unsupported field type: '
+
nodeName
;
break
;
}
try
{
field
.
blur
();
}
catch
(
err
)
{
__utils__
.
log
(
"Unable to blur() input field "
+
field
.
getAttribute
(
'name'
)
+
": "
+
err
,
"warning"
);
}
return
out
;
};
};
...
...
Please
register
or
sign in
to post a comment