How to bypass recaptcha human check in nightwatch test? - testing

I'm writing a nightwatch test for a Backbone View that includes Google's "recaptcha" human check. Obviously, the test is a bot, and so it can't pass the test. So I'm trying to figure out a way to bypass the human check in the test. Can anyone suggest a way to do this that is elegant?
At the moment, the only possibility I can see is setting a query parameter on the url that nightwatch uses to load the page, and then checking for that query parameter within the logic of the Backbone view, but this seems bad. I don't want to have to include logic about testing in the code itself. It's just messy.
Thoughts?

I see Raymond's comment above has the same answer, but I still think to add an answer here should be more visible.
Google has the document for how to bypass reCAPTCHA in test environment, check this:
https://developers.google.com/recaptcha/docs/faq#id-like-to-run-automated-tests-with-recaptcha.-what-should-i-do
For production, I think it's not possible unless you have some smart OCR tools like endtest offers: https://endtest.io/guides/docs/dealing-with-recaptcha/

Related

Cypress not used for tests

So, I am trying to create some sort of bot to interact with Twitter. I am familiar with Cypress and wouldn´t be a problem at all learn how to deal with Selenium, but my point is: for what I´ve been reading, they´re both specific for testing, and what I want to do is not exactly testing, but keep an algorithm running for as long as I want.
I can obviously make a loop on the Cypress or the Selenium code, but I don´t see it as the easier way to deal with the problem.
So my question is: is there some ideal framework to keep pressing buttons or typing stuff for a few days on a webpage, not for testing, but to automatically interact with other accounts?
What you need is what is called an autoclicker.
Although this can be done with Selenium, there are simpler and faster alternatives like this Chrome extension: Auto Click/Auto Fill.
A search for autoclickers can help you figure out the best alternatives for your use case and there are plenty of approaches in many different languages.

Can Katalon Studio read CAPTCHA number while running a test

I want to test login using Katalon, but I use CAPTCHA. The number in CAPTCHA is always changed. Can Katalon read that while running a test?
I don't think you can do that.
CAPTCHA means "Completely Automated Public Turing test to tell Computers and Humans Apart".
So, the whole point of CAPTCHA is it cannot (or shouldn't) be automated.
You can either talk to the developers and try to remove it for testing purposes. Or you can use a service like Death by CAPTCHA.
The primary purpose of CAPTCHA is that it should not be automated. If that is not the case, then the whole purpose of having a CAPTCHA is defeated at first place. I don't think Katalon or any other automation tool should be able (and would be able) to automate CAPTCHA.

Best web application testing tool for the following requirements?

Load HTML pages and check load speeds
Verify completeness of HTML
Follow links on the page
Fill and submit forms
Execute javascript and verify correctness of execution
Verify AJAX calls by mocking the endpoint
Allow flexibly defining tests and expected results
Absolutely everything from here here will probably do. Until you give a few more requirements - language, free vs commercial, a little additional info about Allow flexibly defining tests and expected results etc this is your best chance.
I have decided to use HtmlUnit.

How does Safari's reader feature work?

I want to add a similar feature to a tool I'm making. I'm interested in how it works code-wise. I want to be able get an html page and exclude all but the article.
The Readability project does something similar for chrome and iOS. I'm not sure how it detects the content automatically but I know that Readability has an API for people who want to integrate it's features. You might want to check that out.
http://www.readability.com/learn-more
If you're working with Ruby, you could use Pismo. It extracts an article from a given document.

Is there an equivalent of Don Libes's *expect* tool for scripting interaction with web pages?

In the bad old days of interactive console applications, Don Libes created a tool called Expect, which enabled you to write Tcl scripts that interacted with these applications, much as a user would. Expect had two tremendous benefits:
It was possible to script interactions that otherwise would have had to be repeated by hand, tediously. A classic example was dialup Internet access hell (from the days before PPP).
It was possible to write scripts to test one's own interactive applications, programmatically, as part of a regression suite.
Today most interactive applications are on the web, not on the console. Hence my question: is there any tool that provides the ability to interact with web pages and web forms programmatically, much as Expect provides the ability to interact with console applications programmatically?
(The closest thing I am aware of is Chickenfoot.)
You might be looking for Selenium
I've used Selenium RC in conjunction with Python to drive web page interactions programmatically. This has allowed me to write pretty extensive user tests in which forms and inputs are driven and their results are measured.
Check out the Selenium IDE on Firefox (as mentioned above). It allows you to record tests in the browser and play them back, either using the IDE itself, or the Remote Control app.
Perl Mechanize works pretty well for this exact issue.
HTTPS and some authentication issues are tricky at times. I will be posting couple questions about those in the future.
I did a ton of Expect work in a former life and always thought Don Libes' Expect book was one of the best-written and most enlightening technical books I'd ever seen.
Hands down I would say that Perl's WWW::Mechanize library is what you want. I note above that you were having trouble finding documentation. There is good documentation for it! Look up the module's distribution on search.cpan.org and see what all is packaged with it. There's a FAQ, Cookbook with examples, etc. Plus I've always been able to get help on the web. If you can't get it here, try at use.perl.org or perlmonks.org. WWW::Mechanize's author, Andy Lester, is present on Stack Overflow. (He's also an all around friendly and helpful guy.)
I believe WWW::Mechanize also has a program that is analogous to Expect's autoexpect program: you set up a proxy process running this program as a server, point your browser to it as a proxy, perform the actions you want to automate, and then the proxy program gives you a WWW::Mechanize program for you to use as a base for your project. (If it works like autoexpect, you will certainly want to make modifications from there.)
As mentioned above, WWW::Mechanize is a browser (to be more exact, it is a web client or http client) that happens to be programmable. The last time I looked, there was even work in progress to make it support JavaScript.
In addition to Selenium, if you're doing the Ruby/Rails thing, there's Webrat.