Selenium java not get hardcore detected by google recaptcha - java

Some websites have a "protected" by google recaptcha thing, and it will check the user before letting them use select features of the website. However where this thing fails, is that it won't allow you to fill out recaptcha to prove you are human. It will just deny you access whenever the google recaptcha is suspicious of you. I also noticed that if I go and find a google recaptcha to solve, with the selenium automation extension, it will be literally impossible to solve it, even if the answers are correct 100% of the time. It will give you the hardest level difficulty recaptcha to solve, and every time you solve one, it will just give you another one. I did ten in a row and it still did not let me solve the recaptcha. So how do I use selenium in a testing environment with recaptcha without having back end access to the website I am testing.
I know one person is going to say "CAPTCHA, an acronym for "Completely Automated Turing Test to tell Computers and Humans Apart"." and you are dumb for asking this question, just give up. So if you are going to say that, please move on to the next question.

Related

Java - Go to new url in new window/tab

I want to be able to use Java to tell it to go to X url when X browser is open/running (my lingo is terrible). (Firefox/Chrome/IE is already up, and I want it to go from the default page to let's say Twitter.)
Most of the solutions are using java.awt.Desktop to launch native browser with a url in it, but that isn't useful if I want to change the url later on. (Already on Twitter-Home Page, but want to go to Twitter-Contact Us afterwards.)
The other solutions I've seen involve using Selenium WebDriver, but I also need to eventually learn how to basically force the Java to read a long list of URLs off an excel and simply verify that url isn't dead, and then do this on the Native Android browser, for example. So the Selenium might not be the right choice. Granted, you can also tell me this is an awesome choice for this too if it truly is. I haven't really been exploring Selenium.
Sorry for asking such a basic question. Company wants QA Automation without training/hiring an Automation QA. My end goal (aside not getting canned), is to see if I can get a bunch of urls to load on specific browsers. I can sort of (praying) be able to do stuff with it afterwards.
A simple trick would be to create an add-on( if you know javascript ) which will be quite similar in chrome and firefox (for IE I have no idea in my days it needed BHO) and send websocket commands from java to your addon. But this needs a java websocket server running where your addon will connect when the browser opens. Rest of communication can be carried upon the protocol lines of your requirements.
There are multiple parts to your question.
Read urls from excel.
Use Apache POI to do the same. Selenium code can use the same.
Check that the urls are not dead.
Use any java http client, (apache) to do that without even opening a browser. If the link is dead, it will be dead for all the browser.
Open the links in a multiple browsers.
Selenium is perfect for this. I am assuming that after the page is loaded you have way of validating that the page is correct. Selenium is very powerful here.
Target native android browser too.
I do not know of much difference between this and the previous question unless you are also testing site display based on browser size. The browser is more or less the same as chrome with webkit rendering engine.

Is it possible to automate captcha code using selenium webdriver?

I'm automating this irctc site as hands on selenium webdriver.
It is asking me for captcha code along with username and password. Is there anyway to automate the captcha code?
You obviously failed to understand what CAPTCHA is; from WikiPedia:
A CAPTCHA (a backronym for "Completely Automated Public Turing test to tell Computers and Humans Apart") is a type of challenge-response test used in computing to determine whether or not the user is human.
As was already mentioned in other answers and comments, there are several possible attacks to defeat this. You can get links to several other options from the same WikiPedia page. But note that all of these are more of a proof-of-concept, rather than an out-of-the-box solution.
Since you tagged your question with Selenium, it is possible that you may be using this in an environment that you control, such as test environment at your work. In such a scenario, the easiest solution is to ask your developers to introduce a "test" flag for any non-production deployments. When this flag is active, a predefined phrase will always pass the CAPTCHA for testing purposes. However, you should still have a full-pass test, with everything turned on as if real production.
1.try import this javasc ocr lib or other ocr lib. https://github.com/antimatter15/ocrad.js
2.read the result and pick only upper case char
There is no proper way to automate captcha using Selenium WebDriver.
The only way to run an automated test script involving captcha is to have sufficient delay when the captcha appears so that a human can enter it on the field provided.

Update client computer using web application

I am developing an e-commerce web application, and in that ads from other giants pop up. I figured out that this is done by PriceFountain, which is actually a spyware. I found the steps to remove that from my laptop. more found here.
but the problem is my clients can also have this adware. I want to programmatically do following or either of them, on the client side:: (and if it is not possible at least inform the user to do so)
If, PriceFountain is present, uninstall it from their system. If it is an add-on, remove that.
Activate the pop-up blocker (deactivation can be achieved through javascript and jquery). But I want to activate. My site does not need pop-ups.
Alter the registry of user for the contents of PriceFountain.
I know this is somewhat an unethical hack, but can this be achieved and if so, how?
More of that, it is just my curiosity can we affect client site settings.?
You used to be able to do that (with jscript/vbscript) in IE if and only if the user added your site to his trusted sites (and allowed pretty much everywhere there), or if it was the intranet-site with relaxed permissions.
Back in the old day's I had such a thing for the intranet-help-site where users could browse through the faq and click on the 'execute solution' button for the common 'problems' (previously solved and added to DB).
For rather obvious security-reasons this is no longer the case (although one can still pull some stuff in legacy IE environments).
The point is: you can't do this on other browsers then IE (unless maybe you'd develop separate plug-ins for them and ask your users to install something that will essentially give you access to their whole machine). Realize that effectively what you are asking for is a way to fully control the user's machine. Would you install such a browser (on your parents pc)?
The best course of action would be to face-up, inform your users on your main-website (enter-page) that something bad spread throughout an ad-network and guide them through the steps (that you already found) necessary to relieve them from their problem.
Even if what you asked was possible, you'd still need the user's cooperation somewhere along the way, even if you'd were to write an application for this that the users could download and run (administrative/elevated)..
Good Luck!
EDIT: for the registry you might try something with the answers in this question: read/write to Windows Registry using Java
Still, you'd still need the user's co-operation.

How to go about writing a java http / web robot app?

I'm looking in to trying to build an application that will allow me to interact with specific elements of a web site, without going through a browser.
This is more a matter of general interest but for my prototype I am using the Guardian web site.
I want to log in, crawl through the content to find articles that can be commented on, and then display and allow the logged in user to comment on the articles.
I am a professional java developer but I've never really gone in to http development, and my search for resources that will help me with this project has not turned up much.
Firstly, I suppose I should ask, is this possible?
Secondly if so how would you for instance log in and post a comment to This Article
Have a look at Selenium Webdriver: http://docs.seleniumhq.org/projects/webdriver/
But please be good. Don't make a comment spam robot.

Blackberry browser field implementation

I need to display any web page as a browser field,not browser session.I am building the app in 4.7 OS.Can anyone help me with sample code?
On 4.7 you are stuck with the old browser field. Also known as Browser Field 1. It renders HTML pretty close to how it was on 4.5 devices. There is no way to take advantage of the newer browser that you invoke via browser session. So, you can forget about CSS2 or or JavaScript on the pages you want to render as a browser field. But for the fairly basic stuff it is good enough.
For the sample code - you really should check out and understand all the examples there are in the development package before starting writing the code. It will really save more time than take for learning. Look at components\samples\com\rim\samples\device\blackberry\browser\BrowserFieldDemo.java
I doubt that the problem lies with the browser field per se. Rather with communications.
The people in the post that you refer to were probably suggesting ";deviceside=true" as this gets around the "BES effect" in a simulator.
You may wish to experiment with running the MDS emulator alongside the simulator session as well. There are a number of posts that discuss the impact of deviceside and simulation. You can test in code to see if you are running a simulator so that you can programmatically influence the "BES effect".

Categories

Resources