Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
=Interacting with forms=
fill_in('First Name', :with => 'John')
fill_in('Password', :with => 'Seekrit')
fill_in('Description', :with => 'Really Long Text…')
choose('A Radio Button')
check('A Checkbox')
uncheck('A Checkbox')
attach_file('Image', '/path/to/image.jpg')
select('Option', :from => 'Select Box')
=scoping=
within("//li[@id='employee']") do
fill_in 'Name', :with => 'Jimmy'
end
within(:css, "li#employee") do
fill_in 'Name', :with => 'Jimmy'
end
within_fieldset('Employee') do
fill_in 'Name', :with => 'Jimmy'
end
within_table('Employee') do
fill_in 'Name', :with => 'Jimmy'
end
=Querying=
page.has_xpath?('//table/tr')
page.has_css?('table tr.foo')
page.has_content?('foo')
page.should have_xpath('//table/tr')
page.should have_css('table tr.foo')
page.should have_content('foo')
page.should have_no_content('foo')
find_field('First Name').value
find_link('Hello').visible?
find_button('Send').click
find('//table/tr').click
locate("//*[@id='overlay'").find("//h1").click
all('a').each { |a| a[:href] }
=Scripting=
result = page.evaluate_script('4 + 4');
=Debugging=
save_and_open_page
=Asynchronous JavaScript=
click_link('foo')
click_link('bar')
page.should have_content('baz')
page.should_not have_xpath('//a')
page.should have_no_xpath('//a')
=XPath and CSS=
within(:css, 'ul li') { ... }
find(:css, 'ul li').text
locate(:css, 'input#name').value
Capybara.default_selector = :css
within('ul li') { ... }
find('ul li').text
locate('input#name').value
@Emerson

This comment has been minimized.

Show comment Hide comment
@Emerson

Emerson Mar 10, 2012

Awesome, thanks for this

Emerson commented Mar 10, 2012

Awesome, thanks for this

@nickrivadeneira

This comment has been minimized.

Show comment Hide comment
@nickrivadeneira

nickrivadeneira Mar 20, 2012

Nice...bookmarked this

Nice...bookmarked this

@s1mple

This comment has been minimized.

Show comment Hide comment
@s1mple

s1mple Apr 19, 2012

Useful. Thanks.

s1mple commented Apr 19, 2012

Useful. Thanks.

@lfv89

This comment has been minimized.

Show comment Hide comment
@lfv89

lfv89 May 2, 2012

Thanks !

lfv89 commented May 2, 2012

Thanks !

@mull

This comment has been minimized.

Show comment Hide comment
@mull

mull May 25, 2012

Awesome, thank you.

mull commented May 25, 2012

Awesome, thank you.

@dreki

This comment has been minimized.

Show comment Hide comment
@dreki

dreki Jun 12, 2012

Excellent. Produced a PDF for this (and gave you credit in the metadata): http://cl.ly/0q1y282S3O2j110h0O2u

dreki commented Jun 12, 2012

Excellent. Produced a PDF for this (and gave you credit in the metadata): http://cl.ly/0q1y282S3O2j110h0O2u

@fguillen

This comment has been minimized.

Show comment Hide comment
@fguillen

fguillen Oct 3, 2012

thanks!

fguillen commented Oct 3, 2012

thanks!

@makaroni4

This comment has been minimized.

Show comment Hide comment
@makaroni4

makaroni4 Dec 2, 2012

πŸ‘

πŸ‘

@ghost

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Dec 22, 2012

click('Button Value') > click_on('Button Value')

ghost commented Dec 22, 2012

click('Button Value') > click_on('Button Value')

@borisreitman

This comment has been minimized.

Show comment Hide comment
@borisreitman

borisreitman Dec 26, 2012

Thanks, here's bitcookie 8635

Thanks, here's bitcookie 8635

@qoobaa

This comment has been minimized.

Show comment Hide comment
@qoobaa

qoobaa Jan 26, 2013

using_wait_time 5 do
  # assertions
end

qoobaa commented Jan 26, 2013

using_wait_time 5 do
  # assertions
end
@MilindS

This comment has been minimized.

Show comment Hide comment
@MilindS

MilindS Feb 5, 2013

Thanks....its a quick reference i was looking for.

MilindS commented Feb 5, 2013

Thanks....its a quick reference i was looking for.

@mobile-olx

This comment has been minimized.

Show comment Hide comment
@mobile-olx

mobile-olx Feb 8, 2013

πŸ‘

πŸ‘

@aisensiy

This comment has been minimized.

Show comment Hide comment
@aisensiy

aisensiy Feb 22, 2013

This is great!

This is great!

@AlabamaMike

This comment has been minimized.

Show comment Hide comment
@AlabamaMike

AlabamaMike Feb 27, 2013

Just what I was looking for ... many thanks!

Just what I was looking for ... many thanks!

@afred

This comment has been minimized.

Show comment Hide comment
@afred

afred Mar 15, 2013

+1

afred commented Mar 15, 2013

+1

@wiremine

This comment has been minimized.

Show comment Hide comment
@wiremine

wiremine Mar 17, 2013

+1!

+1!

@amoid125

This comment has been minimized.

Show comment Hide comment
@amoid125

amoid125 Mar 18, 2013

is there any command for refresh button and back button on browser ????

is there any command for refresh button and back button on browser ????

@morganick

This comment has been minimized.

Show comment Hide comment
@morganick

morganick Apr 3, 2013

πŸ‘

πŸ‘

@dsengupta

This comment has been minimized.

Show comment Hide comment
@dsengupta

dsengupta Apr 12, 2013

(y) thanks

(y) thanks

@ZachBeta

This comment has been minimized.

Show comment Hide comment
@ZachBeta

ZachBeta Apr 12, 2013

+1 for updates :-)

+1 for updates :-)

@MissMathmagician

This comment has been minimized.

Show comment Hide comment
@MissMathmagician

MissMathmagician Apr 15, 2013

thank you so much!!you made my life easier <3 <3

thank you so much!!you made my life easier <3 <3

@mariusbutuc

This comment has been minimized.

Show comment Hide comment
@mariusbutuc

mariusbutuc Apr 24, 2013

πŸ‘

πŸ‘

@bradleyd

This comment has been minimized.

Show comment Hide comment
@bradleyd

bradleyd Apr 30, 2013

thanks!

thanks!

@jalevin

This comment has been minimized.

Show comment Hide comment
@jalevin

jalevin May 21, 2013

nice!

jalevin commented May 21, 2013

nice!

@wangzifeng

This comment has been minimized.

Show comment Hide comment
@wangzifeng

wangzifeng Jun 3, 2013

Thanks!

Thanks!

@abotalov

This comment has been minimized.

Show comment Hide comment
@abotalov

abotalov Jun 4, 2013

  1. Correct method name is click_on, not click
  2. default_selector in Capybara 2 is :css so examples in section scoping should be updated.
  3. Capybara 2.1 by default finds only visible elements so find_link('Hello').visible? doesn't really make sense
  4. There's no such method as locate in Capybara
  5. all('a').each { |a| a[:href] } is inefficient if page contains a lot of links and driver is quiet slow (like Selenium) as Capybara will make a query to driver for each invocation of #[]. Instead I advice to get array of elements' attributes using execute_script like it's shown here

abotalov commented Jun 4, 2013

  1. Correct method name is click_on, not click
  2. default_selector in Capybara 2 is :css so examples in section scoping should be updated.
  3. Capybara 2.1 by default finds only visible elements so find_link('Hello').visible? doesn't really make sense
  4. There's no such method as locate in Capybara
  5. all('a').each { |a| a[:href] } is inefficient if page contains a lot of links and driver is quiet slow (like Selenium) as Capybara will make a query to driver for each invocation of #[]. Instead I advice to get array of elements' attributes using execute_script like it's shown here
@zhublik

This comment has been minimized.

Show comment Hide comment
@zhublik

zhublik Jun 6, 2013

Thanks!

zhublik commented Jun 6, 2013

Thanks!

@fahimbpatel

This comment has been minimized.

Show comment Hide comment
@fahimbpatel

fahimbpatel Jun 15, 2013

+1

+1

@HowHai

This comment has been minimized.

Show comment Hide comment
@HowHai

HowHai Jun 20, 2013

Thank you!

HowHai commented Jun 20, 2013

Thank you!

@heymatty

This comment has been minimized.

Show comment Hide comment
@heymatty

heymatty Jul 27, 2013

Awesome, thanks!

Awesome, thanks!

@arnewauters

This comment has been minimized.

Show comment Hide comment
@arnewauters

arnewauters Aug 5, 2013

@zhengjia I believe click method has changed to click_on . Thanks for the sheet

@zhengjia I believe click method has changed to click_on . Thanks for the sheet

@DoctorRu

This comment has been minimized.

Show comment Hide comment
@DoctorRu

DoctorRu Aug 13, 2013

Really thks!

Really thks!

@dillonhafer

This comment has been minimized.

Show comment Hide comment
@dillonhafer

dillonhafer Aug 22, 2013

Thank you!

Thank you!

@FalloutX

This comment has been minimized.

Show comment Hide comment
@FalloutX

FalloutX Aug 26, 2013

Amazing!
BTW, there is no have_selector

Amazing!
BTW, there is no have_selector

@loed-idzinga

This comment has been minimized.

Show comment Hide comment
@loed-idzinga

loed-idzinga Aug 27, 2013

Thank you, very useful!

Thank you, very useful!

@zeroed

This comment has been minimized.

Show comment Hide comment
@zeroed

zeroed Sep 6, 2013

Thanks!

^_^

zeroed commented Sep 6, 2013

Thanks!

^_^

@tomreese

This comment has been minimized.

Show comment Hide comment
@tomreese

tomreese Sep 19, 2013

This is awesome, thanks!

This is awesome, thanks!

@tochman

This comment has been minimized.

Show comment Hide comment
@tochman

tochman Oct 7, 2013

Life saver. Thx.

tochman commented Oct 7, 2013

Life saver. Thx.

@Dorian

This comment has been minimized.

Show comment Hide comment
@Dorian

Dorian Oct 24, 2013

Great, thanks, this is really useful: find('form.foo .btn').click

Dorian commented Oct 24, 2013

Great, thanks, this is really useful: find('form.foo .btn').click

@jalcine

This comment has been minimized.

Show comment Hide comment
@jalcine

jalcine Nov 2, 2013

@FalloutX have_selector works when you use 'expect' syntax:

expect(page).to have_selector 'foobar'

jalcine commented Nov 2, 2013

@FalloutX have_selector works when you use 'expect' syntax:

expect(page).to have_selector 'foobar'
@zaczheng

This comment has been minimized.

Show comment Hide comment
@zaczheng

zaczheng Nov 12, 2013

within now works differently:

within("li#employee") do
fill_in 'Name', :with => 'Jimmy'
end

within(:xpath, "//li[@id='employee']") do
fill_in 'Name', :with => 'Jimmy'
end

You might want to update your gist.

https://github.com/jnicklas/capybara#scoping

within now works differently:

within("li#employee") do
fill_in 'Name', :with => 'Jimmy'
end

within(:xpath, "//li[@id='employee']") do
fill_in 'Name', :with => 'Jimmy'
end

You might want to update your gist.

https://github.com/jnicklas/capybara#scoping

@TomLewis

This comment has been minimized.

Show comment Hide comment
@TomLewis

TomLewis Nov 15, 2013

Very Handy, Thanks!

Very Handy, Thanks!

@passalini

This comment has been minimized.

Show comment Hide comment
@passalini

passalini Nov 21, 2013

Hi, it is very useful. Just for "add value", in multiple select exists unselect(Option, from: select_box)

Hi, it is very useful. Just for "add value", in multiple select exists unselect(Option, from: select_box)

@bf4

This comment has been minimized.

Show comment Hide comment
@bf4

bf4 Dec 5, 2013

Anyone have an up-to-date fork?

bf4 commented Dec 5, 2013

Anyone have an up-to-date fork?

@mangantj

This comment has been minimized.

Show comment Hide comment
@mangantj

mangantj Dec 13, 2013

If you can't find select via

select('Option', :from => 'Select Box')

do

find("#select_id").select("value")

If you can't find select via

select('Option', :from => 'Select Box')

do

find("#select_id").select("value")
@tomaszgiba

This comment has been minimized.

Show comment Hide comment
@tomaszgiba

tomaszgiba Jan 3, 2014

cool!

cool!

@shekibobo

This comment has been minimized.

Show comment Hide comment
@shekibobo

shekibobo Jan 3, 2014

New ability to choose option from a specific radio group (as of 2.2.0):

choose("radio_group_selector", option: "Option 5")

New ability to choose option from a specific radio group (as of 2.2.0):

choose("radio_group_selector", option: "Option 5")
@cirosantilli

This comment has been minimized.

Show comment Hide comment
@s01ipsist

This comment has been minimized.

Show comment Hide comment
@s01ipsist

s01ipsist Feb 11, 2014

When debugging, I have found
page.driver.render 'tmp/page.png'
to be particularly useful to give you an idea of what Poltergeist is looking at on screen

When debugging, I have found
page.driver.render 'tmp/page.png'
to be particularly useful to give you an idea of what Poltergeist is looking at on screen

@yawo

This comment has been minimized.

Show comment Hide comment
@yawo

yawo Feb 14, 2014

great !

yawo commented Feb 14, 2014

great !

@dipak1112

This comment has been minimized.

Show comment Hide comment
@dipak1112

dipak1112 Feb 24, 2014

it's really good and helpfull

it's really good and helpfull

@smokingcat

This comment has been minimized.

Show comment Hide comment
@smokingcat

smokingcat Feb 27, 2014

cool thanks!

cool thanks!

@pete2786

This comment has been minimized.

Show comment Hide comment
@pete2786

pete2786 Mar 19, 2014

Thank you!

Thank you!

@GraceCao

This comment has been minimized.

Show comment Hide comment
@GraceCao

GraceCao Mar 27, 2014

good job, thank you

good job, thank you

@JokinAspiazu

This comment has been minimized.

Show comment Hide comment
@JokinAspiazu

JokinAspiazu Apr 18, 2014

πŸ‘

πŸ‘

@equivalent

This comment has been minimized.

Show comment Hide comment
@equivalent

equivalent Apr 24, 2014

thank you

thank you

@elfassy

This comment has been minimized.

Show comment Hide comment
@elfassy

elfassy Apr 29, 2014

I've added all the comments above to mine: https://gist.github.com/elfassy/11399304

elfassy commented Apr 29, 2014

I've added all the comments above to mine: https://gist.github.com/elfassy/11399304

@Nitesh9952

This comment has been minimized.

Show comment Hide comment
@Nitesh9952

Nitesh9952 May 22, 2014

Good work!!

Good work!!

@prashanth-sams

This comment has been minimized.

Show comment Hide comment
@prashanth-sams

prashanth-sams May 30, 2014

U saved my Day!!

U saved my Day!!

@adamorabi

This comment has been minimized.

Show comment Hide comment
@adamorabi

adamorabi Jun 22, 2014

I have a 2 radio buttons with the same id and label, only different values, (true, false)....anything I can do to choose false?

I have a 2 radio buttons with the same id and label, only different values, (true, false)....anything I can do to choose false?

@purnimashanti

This comment has been minimized.

Show comment Hide comment
@purnimashanti

purnimashanti Jul 2, 2014

select "United States", from: "Country", :match => :first

You can use this if you want to select the first one on the dropdown list.

select "United States", from: "Country", :match => :first

You can use this if you want to select the first one on the dropdown list.

@purnimashanti

This comment has been minimized.

Show comment Hide comment
@purnimashanti

purnimashanti Jul 9, 2014

page.title
it will get the title of the page.

page.title
it will get the title of the page.

@purnimashanti

This comment has been minimized.

Show comment Hide comment
@purnimashanti

purnimashanti Jul 17, 2014

Since the version 2.1.0 of capybara there are methods on the session to deal with the title.
page.title
page.has_title? "my title"
page.has_no_title? "my not found title"

Since the version 2.1.0 of capybara there are methods on the session to deal with the title.
page.title
page.has_title? "my title"
page.has_no_title? "my not found title"

@davidlesches

This comment has been minimized.

Show comment Hide comment
@davidlesches

davidlesches Aug 11, 2014

I'm finding visibility testing to be easier, with:
expect(page).to have_selector('#selector_id', visible: false)

I'm finding visibility testing to be easier, with:
expect(page).to have_selector('#selector_id', visible: false)

@jnrepo

This comment has been minimized.

Show comment Hide comment
@jnrepo

jnrepo Nov 13, 2014

Thanks!

jnrepo commented Nov 13, 2014

Thanks!

@johnwake

This comment has been minimized.

Show comment Hide comment
@johnwake

johnwake Dec 16, 2014

πŸ‘

πŸ‘

@phuong3030

This comment has been minimized.

Show comment Hide comment
@phuong3030

phuong3030 Jan 6, 2015

πŸ‘

πŸ‘

@NourhanAttef

This comment has been minimized.

Show comment Hide comment
@NourhanAttef

NourhanAttef Jan 15, 2015

I have that error undefined method `visit' for #Object:0x007f9355878f08 (NoMethodError)

I have that error undefined method `visit' for #Object:0x007f9355878f08 (NoMethodError)

@juriewessels

This comment has been minimized.

Show comment Hide comment
@juriewessels

juriewessels Feb 11, 2015

Thanks!

Thanks!

@asharma-ror

This comment has been minimized.

Show comment Hide comment
@asharma-ror

asharma-ror Feb 19, 2015

Ultimate

Ultimate

@guih

This comment has been minimized.

Show comment Hide comment
@guih

guih Mar 5, 2015

Thanks! πŸ‘

guih commented Mar 5, 2015

Thanks! πŸ‘

@st0012

This comment has been minimized.

Show comment Hide comment
@st0012

st0012 Mar 7, 2015

Thanks!

st0012 commented Mar 7, 2015

Thanks!

@dcharan

This comment has been minimized.

Show comment Hide comment
@dcharan

dcharan Mar 16, 2015

Capybara automatically waits for asynchronous operations to complete. When you try to find an element that isn't on the page, it waits and retries until it is there, or a timeout duration elapses. The wait time is defined at Capybara.default_wait_time

Here are the methods that waits:

  • find(selector), find_field, find_link
  • within(selector)(scoping)
    *has_selector?/has_no_selector? & assertions
  • form & link actions
    • click_link/button
    • fill_in
    • check/uncheck, select, choose

Here are the methods that doesn't wait:

  • visit
  • current_path
  • all (selector)
  • first(selector)
  • execute_script
  • simple accessors: text, value, title, etc.

Reference

Note that Capybara.default_wait_time has been changed to Capybara.default_max_wait_time

dcharan commented Mar 16, 2015

Capybara automatically waits for asynchronous operations to complete. When you try to find an element that isn't on the page, it waits and retries until it is there, or a timeout duration elapses. The wait time is defined at Capybara.default_wait_time

Here are the methods that waits:

  • find(selector), find_field, find_link
  • within(selector)(scoping)
    *has_selector?/has_no_selector? & assertions
  • form & link actions
    • click_link/button
    • fill_in
    • check/uncheck, select, choose

Here are the methods that doesn't wait:

  • visit
  • current_path
  • all (selector)
  • first(selector)
  • execute_script
  • simple accessors: text, value, title, etc.

Reference

Note that Capybara.default_wait_time has been changed to Capybara.default_max_wait_time

@dantesolis

This comment has been minimized.

Show comment Hide comment
@dantesolis

dantesolis Mar 28, 2015

Thanks!!

Thanks!!

@cleeverz

This comment has been minimized.

Show comment Hide comment
@cleeverz

cleeverz Mar 31, 2015

Comes in handy ALL the time. Thanks :)

Comes in handy ALL the time. Thanks :)

@fcarrega

This comment has been minimized.

Show comment Hide comment
@fcarrega

fcarrega Apr 2, 2015

πŸ‘

fcarrega commented Apr 2, 2015

πŸ‘

@lccezinha

This comment has been minimized.

Show comment Hide comment
@lccezinha

lccezinha Apr 30, 2015

Thanks man!

Thanks man!

@ppj

This comment has been minimized.

Show comment Hide comment
@ppj

ppj May 6, 2015

Thanks πŸ‘

ppj commented May 6, 2015

Thanks πŸ‘

@squanto

This comment has been minimized.

Show comment Hide comment
@squanto

squanto May 8, 2015

πŸ˜„

squanto commented May 8, 2015

πŸ˜„

@mike-foucault

This comment has been minimized.

Show comment Hide comment
@mike-foucault

mike-foucault May 9, 2015

πŸ‘

πŸ‘

@SamuraiT

This comment has been minimized.

Show comment Hide comment
@SamuraiT

SamuraiT May 12, 2015

πŸ‘

πŸ‘

@antwonlee

This comment has been minimized.

Show comment Hide comment
@antwonlee

antwonlee May 31, 2015

πŸ‘

πŸ‘

@AndreiRailean

This comment has been minimized.

Show comment Hide comment
@AndreiRailean

AndreiRailean Jun 19, 2015

πŸ‘

πŸ‘

@marceloribeiro

This comment has been minimized.

Show comment Hide comment
@marceloribeiro

marceloribeiro Jul 2, 2015

πŸ‘

πŸ‘

@wolftatsu

This comment has been minimized.

Show comment Hide comment
@wolftatsu

wolftatsu Jul 29, 2015

nice

nice

@IdarV

This comment has been minimized.

Show comment Hide comment
@IdarV

IdarV Aug 10, 2015

Thank you for this

IdarV commented Aug 10, 2015

Thank you for this

@LNA

This comment has been minimized.

Show comment Hide comment
@LNA

LNA Sep 4, 2015

Thank you for this πŸ‘ πŸ‘ πŸ‘

LNA commented Sep 4, 2015

Thank you for this πŸ‘ πŸ‘ πŸ‘

@ilyakrasnov

This comment has been minimized.

Show comment Hide comment
@ilyakrasnov

ilyakrasnov Sep 10, 2015

Thanks a lot!

Thanks a lot!

@netes

This comment has been minimized.

Show comment Hide comment
@netes

netes Sep 10, 2015

πŸ‘

netes commented Sep 10, 2015

πŸ‘

@mikesorae

This comment has been minimized.

Show comment Hide comment
@mikesorae

mikesorae Oct 1, 2015

it's a great help for me

it's a great help for me

@aliibrahim

This comment has been minimized.

Show comment Hide comment
@aliibrahim

aliibrahim Oct 16, 2015

πŸ‘

πŸ‘

@OctavianRotari

This comment has been minimized.

Show comment Hide comment
@OctavianRotari

OctavianRotari Oct 27, 2015

πŸ‘

πŸ‘

@shashwathi

This comment has been minimized.

Show comment Hide comment
@shashwathi

shashwathi Oct 29, 2015

Is the "fill_in" function taking in the ID of a textfield or the label associated with the textfield?

Is the "fill_in" function taking in the ID of a textfield or the label associated with the textfield?

@mib32

This comment has been minimized.

Show comment Hide comment
@mib32

mib32 Nov 2, 2015

@shashwathi You can feed both of them, it handles that automatically

mib32 commented Nov 2, 2015

@shashwathi You can feed both of them, it handles that automatically

@Nyberg

This comment has been minimized.

Show comment Hide comment
@Nyberg

Nyberg Nov 11, 2015

πŸ‘

Nyberg commented Nov 11, 2015

πŸ‘

@gunesmes

This comment has been minimized.

Show comment Hide comment
@gunesmes

gunesmes Nov 17, 2015

πŸ‘

πŸ‘

@philiboua

This comment has been minimized.

Show comment Hide comment
@philiboua

philiboua Nov 26, 2015

great job ;)

great job ;)

@adamantnz

This comment has been minimized.

Show comment Hide comment
@adamantnz

adamantnz Dec 29, 2015

super handy, thanks! πŸ‘

super handy, thanks! πŸ‘

@kozyty

This comment has been minimized.

Show comment Hide comment
@kozyty

kozyty Jan 7, 2016

thx! πŸ‘

kozyty commented Jan 7, 2016

thx! πŸ‘

@lucasklaassen

This comment has been minimized.

Show comment Hide comment
@lucasklaassen

lucasklaassen Jan 13, 2016

thx

thx

@alexdesi

This comment has been minimized.

Show comment Hide comment
@alexdesi

alexdesi Jan 21, 2016

I did find on this doc a way to find a text (and then click on it),
after googling a bit found this:
find('.clickable-text', :text => 'Click me').click
hope it can help someone

I did find on this doc a way to find a text (and then click on it),
after googling a bit found this:
find('.clickable-text', :text => 'Click me').click
hope it can help someone

@babasbot

This comment has been minimized.

Show comment Hide comment
@babasbot

babasbot Jan 26, 2016

πŸ‘

πŸ‘

@kishorsharma69

This comment has been minimized.

Show comment Hide comment
@kishorsharma69

kishorsharma69 Feb 18, 2016

how to fill in text in masked input field?

how to fill in text in masked input field?

@katlavan

This comment has been minimized.

Show comment Hide comment
@katlavan

katlavan Feb 18, 2016

πŸ‘

πŸ‘

@manwinder123

This comment has been minimized.

Show comment Hide comment
@manwinder123

manwinder123 Mar 30, 2016

πŸ‘

πŸ‘

@OnlySteveH

This comment has been minimized.

Show comment Hide comment
@OnlySteveH

OnlySteveH Apr 8, 2016

Thanks for this - very handy! πŸ‘ πŸ˜‰

Thanks for this - very handy! πŸ‘ πŸ˜‰

@iqbalhasnan

This comment has been minimized.

Show comment Hide comment
@iqbalhasnan

iqbalhasnan Apr 28, 2016

:shipit:

@EricA-G

This comment has been minimized.

Show comment Hide comment
@EricA-G

EricA-G May 12, 2016

Good stuff

EricA-G commented May 12, 2016

Good stuff

@jeffreyjurgajtis

This comment has been minimized.

Show comment Hide comment
@jeffreyjurgajtis

jeffreyjurgajtis May 16, 2016

πŸ‘

πŸ‘

@Dorian

This comment has been minimized.

Show comment Hide comment
@Dorian

Dorian Jun 9, 2016

@WaKeMaTTa: Thanks <3

Dorian commented Jun 9, 2016

@WaKeMaTTa: Thanks <3

@bramj

This comment has been minimized.

Show comment Hide comment
@bramj

bramj Jun 17, 2016

Been using this for years now without saying thanks... Thanks!

bramj commented Jun 17, 2016

Been using this for years now without saying thanks... Thanks!

@FottyM

This comment has been minimized.

Show comment Hide comment
@FottyM

FottyM Jun 17, 2016

Nice

FottyM commented Jun 17, 2016

Nice

@maxigimenez

This comment has been minimized.

Show comment Hide comment
@maxigimenez

maxigimenez Jun 20, 2016

To debug save_and_open_screenshot is useful

To debug save_and_open_screenshot is useful

@erich

This comment has been minimized.

Show comment Hide comment
@erich

erich Jun 22, 2016

πŸ‘

erich commented Jun 22, 2016

πŸ‘

@aureliosaraiva

This comment has been minimized.

Show comment Hide comment
@aureliosaraiva

aureliosaraiva Jun 28, 2016

o/

@kdabrowski

This comment has been minimized.

Show comment Hide comment
@kdabrowski

kdabrowski Jul 14, 2016

πŸ‘

πŸ‘

@EvanTedesco

This comment has been minimized.

Show comment Hide comment
@EvanTedesco

EvanTedesco Jul 14, 2016

I have used this resource so many times I just wanted to say thanks!

I have used this resource so many times I just wanted to say thanks!

@Victorrent

This comment has been minimized.

Show comment Hide comment
@Victorrent

Victorrent Aug 11, 2016

I really appreciate you putting this together.

I really appreciate you putting this together.

@catherine-jones

This comment has been minimized.

Show comment Hide comment
@catherine-jones

catherine-jones Sep 5, 2016

πŸ‘

πŸ‘

@DougMaisells

This comment has been minimized.

Show comment Hide comment
@DougMaisells

DougMaisells Sep 12, 2016

find("input[attribute='value']") where input is an input tag, and attribute is something like name I have found these command useful.

find("input[attribute='value']") where input is an input tag, and attribute is something like name I have found these command useful.

@alexeymetelev

This comment has been minimized.

Show comment Hide comment
@alexeymetelev

alexeymetelev Oct 21, 2016

πŸ‘

πŸ‘

@Jbur43

This comment has been minimized.

Show comment Hide comment
@Jbur43

Jbur43 Oct 30, 2016

Thanks!

Jbur43 commented Oct 30, 2016

Thanks!

@pixelgoo

This comment has been minimized.

Show comment Hide comment
@pixelgoo

pixelgoo Dec 7, 2016

Really helpful!

pixelgoo commented Dec 7, 2016

Really helpful!

@ff-dmiller

This comment has been minimized.

Show comment Hide comment
@ff-dmiller

ff-dmiller Jan 9, 2017

πŸ‘

πŸ‘

@pdxmike

This comment has been minimized.

Show comment Hide comment
@pdxmike

pdxmike Jan 22, 2017

This is great. Thank you!

pdxmike commented Jan 22, 2017

This is great. Thank you!

@smoyth

This comment has been minimized.

Show comment Hide comment
@ckib16

This comment has been minimized.

Show comment Hide comment
@ckib16

ckib16 Feb 24, 2017

Nice @hooverlunch, thanks!

ckib16 commented Feb 24, 2017

Nice @hooverlunch, thanks!

@jepjep70

This comment has been minimized.

Show comment Hide comment
@jepjep70

jepjep70 Feb 25, 2017

Guys good day. Can you help me on how can i create a test report when i am using capybara-cucumber in my automation. What gem should i need to install and how should i invoke it. Thank you in advance.

Guys good day. Can you help me on how can i create a test report when i am using capybara-cucumber in my automation. What gem should i need to install and how should i invoke it. Thank you in advance.

@cooljl31

This comment has been minimized.

Show comment Hide comment
@cooljl31

cooljl31 Mar 20, 2017

πŸ‘

πŸ‘

@pmaderamitlasf1

This comment has been minimized.

Show comment Hide comment
@pmaderamitlasf1

pmaderamitlasf1 May 12, 2017

I am unable to hit "enter" key , any solution?

I am unable to hit "enter" key , any solution?

@gustavo-freitas

This comment has been minimized.

Show comment Hide comment
@gustavo-freitas

gustavo-freitas May 30, 2017

This is simple and great. Thanks!

This is simple and great. Thanks!

@jumbosushi

This comment has been minimized.

Show comment Hide comment
@jumbosushi

jumbosushi Jul 12, 2017

I'm always coming back to this. Thanks for a great list!

I'm always coming back to this. Thanks for a great list!

@ElizabethCobian

This comment has been minimized.

Show comment Hide comment
@ElizabethCobian

ElizabethCobian Aug 24, 2017

Excellent! Thanks :)

Excellent! Thanks :)

@itumoraes

This comment has been minimized.

Show comment Hide comment
@itumoraes

itumoraes Sep 20, 2017

Awesome!

Awesome!

@Arunk1390

This comment has been minimized.

Show comment Hide comment
@Arunk1390

Arunk1390 Oct 23, 2017

Thanks for this great gist πŸ‘

Thanks for this great gist πŸ‘

@Pomeha

This comment has been minimized.

Show comment Hide comment
@Pomeha

Pomeha Nov 27, 2017

Great! πŸ‘

Pomeha commented Nov 27, 2017

Great! πŸ‘

@AndrewFReda

This comment has been minimized.

Show comment Hide comment
@AndrewFReda

AndrewFReda Dec 18, 2017

Awesome, thanks! (FYI, this gist was used by LaunchAcademy here)

Awesome, thanks! (FYI, this gist was used by LaunchAcademy here)

@vishakhapanat

This comment has been minimized.

Show comment Hide comment
@vishakhapanat

vishakhapanat Jan 7, 2018

When i use find(<name_of_object>).click, I get following error
Unable to find css "" (Capybara::ElementNotFound)
Can someone please help?

vishakhapanat commented Jan 7, 2018

When i use find(<name_of_object>).click, I get following error
Unable to find css "" (Capybara::ElementNotFound)
Can someone please help?

@leylaKapi

This comment has been minimized.

Show comment Hide comment
@leylaKapi

leylaKapi Mar 1, 2018

@vishakhapanat Did you find a solution for your error?

@vishakhapanat Did you find a solution for your error?

@igbanam

This comment has been minimized.

Show comment Hide comment
@igbanam

igbanam Mar 14, 2018

To note, things like have_css, and have_xpath also have some optional arguments which help better querying. For instance have_css(".widget", maximum: 2)

igbanam commented Mar 14, 2018

To note, things like have_css, and have_xpath also have some optional arguments which help better querying. For instance have_css(".widget", maximum: 2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment