Unable to get Image Validation via recaptcha - angularjs

I have incorporated Google ReCaptcha in my angular project on the client side and it was working fine. I have not changed anything but now I am unable to get image validation dialog box like I used to get before.
Now when I check on "I am not a robot" It verifies directly without asking for image validation and I am able to get the response string from Google API.
Is this behaviour is expected? and what can I do if I want Image validation after checking on "I am not a robot"?

I figured it out when I tried in another browser it asked me for image validation because after testing many times and verifying by my server, recaptcha does not ask for image validation.

Related

Chrome is detecting password input on a UIGrid page selector, prompting user to generate password when changing grid page?

I encountered a bug in a .net web application using Angular JS UIGrid. When changing the page (using uiGridPagination) Chrome is suggesting a recommended password to the user as if it was a password textbox.
I cant share any code due to the nature of the application but hopefully someone can lead me in the right direction.
e.g. What causes Chromes password detection to activate?

How can I simulate hitting enter or clicking outside a filled form to send data to server?

I have a Rails app and and a form using React. When a user fills a field, the data is sent the moment they press enter on their keyboard or when they clicks anywhere else on the page.
I'm testing this feature and I'm trying to reproduce the same behavior but what I've tried so far do not work...
I'm using Capybara with Rspec to test features. I've already tried those following:
find('.class').set("text").native.send_keys(:return)
find('.class').set("text\n")
page.execute_script("document.querySelector('.some_other_div').click()")
fill_in "name", with: "text\n"
I have no problem to fill the form but I am not able to send it to the server...
Thank you for your help!

Angular Fallback Image With Status Code

I'm trying to get a fallback image working that behaves differently based on the status code. My images are coming out of SharePoint and in certain (Microsoft) browsers I have to request the images through a Web API so that I can append the proper authentication cookies.
I already have a fallback working that if an image fails it requests the image through the Web API and gets the Base64 representation. The problem is there's no point doing this if the image isn't there. So if it's a 404 I'd like to just display the placeholder, but if it's a 302 I'll get the image a different way.
Checking the error object and all the fallback directives I can find, I can't see a way to find out the error code.
Thanks!

How can I implement the facebook authentication in a MEAN application preventing CORS problems?

I'm implementing an application using the full MEAN stack.
I created a login page to signup with facebook to be able to show a profile page. But I discovered some problems. For this reason, I created a smaller version of my webapp, maintaining the same project structure.
The complete code, executable (only replacing "client id" and "secret") with "npm install" and after "nodemon" is available here: https://github.com/Ks89/MEAN-OAuth_Example
If I'll call (with a browser) the rest API that I created to login with facebook at "http://localhost:3000/api/auth/facebook", everything will be ok!
But if I'll want to do the same thing, clicking on the "Login" button, I'll receive the error as in figure:
I know that the problem is related to CORS, but how can I'll fix this in my application, maintaining the same project structure?
I don't want to put the "rest path" inside the HTML. I tried for many days different solutions without success.
If you want, experiment directly on my application that I created exactly to write this question ;).
If really necessary, I'll able to post the entire source code here, but I prefer an organized and executable code into a repository for this particular question.
Please, give me some ideas and hopefully a solution, because I'm really blocked.
The example routes from the passport-facebook repo are intended for multipage apps, not ajax requests. If you look at what those routes are doing, /auth/facebook is just a redirect to Facebook where the user is expected to log in if necessary and authorize your application. When you make that same request from angular, it follows the redirect and tries to load the Facebook page, but the browser blocks you as your console screenshot shows. CORS would be relevant if Facebook wanted to allow you to request their login form across origins, but they don't because that would basically make you a phisher.
It looks like you're trying to handle authentication without leaving the page, but at some point you're going to need the user to leave your site and be redirected to Facebook in order to complete the OAuth flow. You can either open a pop-up containing the Facebook OAuth dialog (it looks like this is what the Facebook JavaScript SDK does by default) or just use your app's current tab with something as simple as <a ng-href="{{facebookOauthUrl}}">Log in with Facebook</a>.

how to verify the tooltip in extjs application with selenium ide

I learning automation of application with selenium ide.The application which I am currently testing is a extjs application.In this application all the required validations are shown in the tooltip.For ex: I have password form in which new password and confirm password are the two fields and there is a submit button.If the password entered in the new and confirm password field do not match then "Password do not match" message is shown in the tooltip and the submit button is disabled.In this case how to verify the tooltip and its contents in the selenium.
Plz can anyone suggest some solution to the above problem?All validation in my application are shown in the tooltip.
thanks,
sushi
First, make sure that you explicitly assign ids to your fields. Otherwise, it will be very hard to get a hold of the components with the automatically generated ids (like "ext-comp-004").
The strategy is to use the verifyEval Selenium command and use the Ext JS API to do certain things.
For checking the active error message of a field with id "password_confirm", you can use:
Ext.getCmp("password_confirm").getActiveError();
First, try this in the Firebug console manually to make sure it works for you. Then you can do the same in your Selenium script as:
Command: verifyEval
Script: Ext.getCmp("password_confirm").getActiveError()
Expected: Passwords do not match
If you want to test this out with Selenium IDE in Firefox first, you should take into account that the window object will be wrapped in a XPCNativeWrapper. You can access the actual window object and the Ext JS namespace in it through wrappedJSObject:
Command: verifyEval
Script: window.wrappedJSObject.Ext.getCmp("password_confirm").getActiveError()
Expected: Passwords do not match
For some general tips on testing Ext JS applications with Selenium, see this answer. Some parts of it may be outdated, but can still give you an idea about the general strategies involved.

Resources