-2

Some one is sending the junk data through registration form. we have implemented invisible captcha to the user registration form.

We want to test the captcha. How can we loop through a rails form and filling the junk data(through Faker gem or any test data generation gem) and submit the form, to test that invisible captcha?

100.times do |i|
   registration_page_url = "xyz.com"
   name = Faker.name
   mobile = Faker.mobile
   email = Faker.email
   save the form.
   sleep(4)
end

Can some one help me with this.

John
  • 1,273
  • 3
  • 27
  • 61

1 Answers1

0

Did you do custom implementation of captcha or is that invisible captcha gem (https://github.com/markets/invisible_captcha)? For gem, check the testing instructions.

In any case, for populating web form with faker gem you need to write some feature tests, you can use rspec: https://relishapp.com/rspec/rspec-rails/docs/feature-specs/feature-spec or help yourself with capybara: https://github.com/teamcapybara/capybara

Hope you find this helpful!

pazinjanka
  • 325
  • 1
  • 7