<s>
Capybara	B-Library
is	O
a	O
web-based	B-Application
test	B-Application
automation	I-Application
software	I-Application
that	O
simulates	O
scenarios	O
for	O
user	O
stories	O
and	O
automates	O
web	B-Application
application	I-Application
testing	O
for	O
behavior-driven	O
software	O
development	O
.	O
</s>
<s>
It	O
is	O
written	O
in	O
the	O
Ruby	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
Capybara	B-Library
can	O
mimic	O
actions	O
of	O
real	O
users	O
interacting	O
with	O
web-based	B-Application
applications	I-Application
.	O
</s>
<s>
It	O
can	O
receive	O
pages	O
,	O
parse	O
the	O
HTML	B-Language
and	O
submit	O
forms	B-General_Concept
.	O
</s>
<s>
By	O
extending	O
the	O
human-readable	O
behavior-driven	O
development	O
style	O
of	O
frameworks	O
such	O
as	O
Cucumber	B-Application
and	O
RSpec	B-Application
into	O
the	O
automation	O
code	O
itself	O
,	O
Capybara	B-Library
aims	O
to	O
develop	O
simple	O
web-based	B-Application
automated	B-Application
tests	I-Application
.	O
</s>
<s>
Capybara	B-Library
is	O
a	O
Ruby	B-Language
library	O
(	O
also	O
referred	O
to	O
as	O
a	O
gem	B-Application
)	O
that	O
is	O
used	O
with	O
an	O
underlying	O
web-based	B-Application
driver	O
.	O
</s>
<s>
It	O
consists	O
of	O
a	O
user-friendly	O
DSL	B-Language
(	O
Domain	B-Language
Specific	I-Language
Language	I-Language
)	O
which	O
describe	O
actions	O
that	O
are	O
executed	O
by	O
the	O
underlying	O
web	O
driver	O
.	O
</s>
<s>
When	O
the	O
page	O
is	O
loaded	O
using	O
the	O
DSL	B-Language
(	O
and	O
underlying	O
web	O
driver	O
)	O
,	O
Capybara	B-Library
will	O
attempt	O
to	O
locate	O
the	O
relevant	O
element	O
in	O
the	B-General_Concept
DOM	I-General_Concept
(	O
Document	B-General_Concept
Object	I-General_Concept
Model	I-General_Concept
)	O
and	O
execute	O
an	O
action	O
such	O
as	O
click	O
button	O
,	O
link	O
,	O
etc	O
.	O
</s>
<s>
By	O
default	O
,	O
Capybara	B-Library
uses	O
the	O
:rack_test	O
driver	O
which	O
does	O
not	O
have	O
any	O
support	O
for	O
executing	O
JavaScript	B-Language
.	O
</s>
<s>
Some	O
of	O
the	O
web	O
drivers	O
supported	O
by	O
Capybara	B-Library
are	O
mentioned	O
below	O
.	O
</s>
<s>
Written	O
in	O
Ruby	B-Language
,	O
Capybara	B-Library
's	O
default	O
driver	O
RackTest	O
does	O
not	O
require	O
a	O
server	O
to	O
be	O
started	O
since	O
it	O
directly	O
interacts	O
with	O
Rack	B-Application
interfaces	O
.	O
</s>
<s>
Consequently	O
,	O
it	O
can	O
only	O
be	O
used	O
for	O
Rack	B-Application
applications	O
.	O
</s>
<s>
Selenium-webdriver	O
,	O
which	O
is	O
mostly	O
used	O
in	O
web-based	B-Application
automation	O
frameworks	O
,	O
is	O
supported	O
by	O
Capybara	B-Library
.	O
</s>
<s>
Unlike	O
Capybara	B-Library
's	O
default	O
driver	O
,	O
it	O
supports	O
JavaScript	B-Language
,	O
can	O
access	O
HTTP	O
resources	O
outside	O
of	O
application	O
and	O
can	O
also	O
be	O
set	O
up	O
for	O
testing	O
in	O
headless	O
mode	O
which	O
is	O
especially	O
useful	O
for	O
CI	O
scenarios	O
.	O
</s>
<s>
Capybara-webkit	O
driver	O
(	O
a	O
gem	B-Application
)	O
is	O
used	O
for	O
true	O
headless	B-Protocol
browser	I-Protocol
testing	O
with	O
JavaScript	B-Language
support	O
.	O
</s>
<s>
It	O
uses	O
QtWebKit	O
and	O
it	O
is	O
significantly	O
faster	O
than	O
Selenium	B-Library
as	O
it	O
does	O
not	O
load	O
the	O
entire	O
browser	O
.	O
</s>
<s>
Capybara	B-Library
locates	O
an	O
element	O
either	O
using	O
Domain-specific	B-Language
language	I-Language
or	O
XPath/CSS	O
Selectors	O
.	O
</s>
<s>
The	O
following	O
are	O
the	O
matching	O
strategies	O
supported	O
by	O
Capybara	B-Library
:	O
</s>
<s>
smart	O
:	O
If	O
Capybara.exact	O
is	O
true	O
,	O
it	O
behaves	O
like	O
the	O
above	O
option	O
(	O
one	O
)	O
.	O
</s>
<s>
If	O
Capybara.exact	O
is	O
false	O
,	O
it	O
will	O
first	O
try	O
to	O
find	O
an	O
exact	O
match	O
.	O
</s>
<s>
Here	O
is	O
an	O
example	O
of	O
how	O
user	O
registration	O
test	O
is	O
done	O
using	O
Capybara	B-Library
.	O
</s>
<s>
An	O
example	O
of	O
a	O
Capybara	B-Library
feature	O
used	O
with	O
Cucumber	B-Application
:	O
</s>
