ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-WebDriver/WebDriver.pm
(Generate patch)

Comparing AnyEvent-WebDriver/WebDriver.pm (file contents):
Revision 1.20 by root, Wed Aug 29 08:13:22 2018 UTC vs.
Revision 1.21 by root, Wed Aug 29 08:14:54 2018 UTC

1084 ->click (1, 100, "mouse") 1084 ->click (1, 100, "mouse")
1085 ->type ("some text") 1085 ->type ("some text")
1086 ->key ("{Enter}") 1086 ->key ("{Enter}")
1087 ->perform; 1087 ->perform;
1088 1088
1089When you specify the event source expliticly it will switch the current 1089When you specify the event source explicitly it will switch the current
1090"focus" for this class of device (all keyboards are in one class, all 1090"focus" for this class of device (all keyboards are in one class, all
1091pointer-like devices such as mice/fingers/pens are in one class), so you 1091pointer-like devices such as mice/fingers/pens are in one class), so you
1092don't have to specify the source for subsequent actions. 1092don't have to specify the source for subsequent actions.
1093 1093
1094When you use the sources C<keyboard>, C<mouse>, C<touch1>..C<touch3>, 1094When you use the sources C<keyboard>, C<mouse>, C<touch1>..C<touch3>,
1118 bless \%kv, $class 1118 bless \%kv, $class
1119} 1119}
1120 1120
1121=item $al = $al->source ($id, $type, key => value...) 1121=item $al = $al->source ($id, $type, key => value...)
1122 1122
1123The first time you call this with a givne ID, this defines the event 1123The first time you call this with a given ID, this defines the event
1124source using the extra parameters. Subsequent calls merely switch the 1124source using the extra parameters. Subsequent calls merely switch the
1125current source for its event class. 1125current source for its event class.
1126 1126
1127It's not an error to define built-in sources (such as C<keyboard> or 1127It's not an error to define built-in sources (such as C<keyboard> or
1128C<touch1>) differently then the defaults. 1128C<touch1>) differently then the defaults.
1129 1129
1130Example: define a new touch device called C<fatfinger>. 1130Example: define a new touch device called C<fatfinger>.
1131 1131
1132 $al->source (fatfinger => "pointer", pointerType => "touch"); 1132 $al->source (fatfinger => "pointer", pointerType => "touch");
1133 1133
1134Example: switchdefine a new touch device called C<fatfinger>. 1134Example: define a new touch device called C<fatfinger>.
1135 1135
1136 $al->source (fatfinger => "pointer", pointerType => "touch"); 1136 $al->source (fatfinger => "pointer", pointerType => "touch");
1137
1138Example: switch default keyboard source to C<kbd1>, assuming it is of C<key> class.
1139
1140 $al->source ("kbd1");
1137 1141
1138=cut 1142=cut
1139 1143
1140sub _default_source($) { 1144sub _default_source($) {
1141 my ($source) = @_; 1145 my ($source) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines