Skip to main content

Posts

Web Functional Testing Automation using CasperJS and Nodejs

Background We are in era the of Web, Mobility and AI. Days are gone where we used to think Javascript is just for client side validation check before submitting web forms. Thanks to ECMAScript5 and above which advanced javascript language way forward. Many Enterprises across the world already building applications using lot of opensource Javascript technologies.  Automating the Testing of any web application is becoming challenging and critical for the business. Challenge is in terms of manage and maintain test hygiene throughout the application life cycle and overall product quality. The ideal behavior of any test automation is to be able to integrate as part of CI and CD  (Continuous Deployment)  build and be able to run without manual test run effort and publish test results with code coverage metrics. There are many different frameworks available in the market to solve automation problem. To name few:  CodedUI -  Browser based test automation suite on .net Selenium

Upgrading from ASP.NET.Identity 1.0 to 2.0

ASP.NET.Identity 2.0 is out, and it adds a bunch of great features. – Two-Factor Authentication (SMS, Email or custom) – Account Lockout – Account Confirmation via Email – Password Reset – Sign out everywhere – Choose your Primary Key type (string, int, Guid) – IQuerable Users and Roles – Delete User – Enforcing Unique User Names The upgrade was more fiddly than I thought it would be. Here is what I had to do. I hope it helps. 1. Update Entity Framework to 6.1 2: Update all your OWIN components if they already exist in your project. (Yes. NuGet should handle this for me. It didn’t. Upgrading the Owin components before the Identity packages resolved some issues for me) 3: Update Microsoft ASP.Net Identity Core and then ASP.Net Identity EntityFramework

Reboot WorkerRole using Azure Automation RUNBOOK

Problem:  Scheduling worker role can become a big pain when it comes to long running background tasks. This is because there are no scheduling options available for worker role (as on date of publishing this article) although there are some alternatives to sleep worker role for a while. We needed to automate the process re-executing worker role based on schedule typically every day interval.  We choose Webjobs as it has best scheduling options to execute back ground jobs. Although, we can interact with azure cloud management using azure management libraries and management certificate, it became hard to encrypt the sensitive information such as certificate string, subscription id etc,. Solution: We found Automation RunBooks are the way to go to solve this problem. As it has out-of the-box support to write powershell workflows to manage azure. Nice thing about Runbooks is that it has good scheduling options so that we can schedule workflow as a recurring event.  Also, all thi

Remote debugging Windows azure cloud service - Worker Role

Remote debugging Windows azure cloud service - Worker Role Very recently I was working on design and development of a worker role component of cloud service. Locally debugging worker role is pretty easy. You just need to know that you need to set Cloud project as a start-up project and ready to go. Problem is when you deploy worker role to azure and trying to troubleshoot an unknown issue.  Thankfully we have remote debugging enable for cloud services – both web and worker roles. This is really handy tool to remotely debug without having to putting a lot of tracing and digging into it. However, remote debugging in worker role/web role requires few steps to be followed: Make sure you are debugging from same machine where you published Make sure to turn on Remote debugger on while you publish (This should be turned off for Production publish profiles) Make sure to Select Debug mode With all the above settings after you publish, you should be able to Attach D

Processing AntiForgeryToken send with Ajax

You might have seen below error while doing ajax post to MVC action that validates AntiForgeryToken. ASP.net MVC ValidateAntiForgeryToken does not handle passing RVToken in ajax requests by default. ex: Below token sent in header won't be accepted at Controller level in MVC: __RequestVerificationToken = $('[name=__RequestVerificationToken]').val() I found a  better solution that works perfectly fine for all POST requests. Just implement the custom MVC Authorize attribute as shown below code:  [AttributeUsage(AttributeTargets.Class, AttributeTargets.Method)] public class MyValidateAntiForgeryToken : AuthorizeAttribute { public override void OnAuthorization( AuthorizationContext filterContext ) { var request = filterContext.HttpContext.Request; if (request.HttpMethod == WebRequestMethods.Http.Post) { if (request.IsAjaxRequest()) { var antiForgeryCookie = request.Cookies[AntiForgeryConfi

Web-API - RESTful Services on Microsoft .net for building Ubiquitous web world

It's been very interesting to note about the fantastic things happening in the world of web development. Finally, we got the solid framework for building RESTful services on Microsoft platform. Let's have a very  quick look at the basic detail. REST [Representation State Transfer Protocol]           A representation is a opaque string of bytes that is effectively manifestation of a resource. REST was never about pretty URLs. The whole point of the hypermedia is that client should not need to know how to construct these URLs in the first place. For your clients, they are just STRINGS.           Web-API can be used when you have clients which consumes data from server over HTTP. Now a days, lot of browser applications are rich clients with web server returns some static html and then may be it uses client side framework like jquery, backbonejs or knockoutjs and makes calls back to server to pull data to execute some client-side functionality. Web-API's role is not j

dbms_output.put_line NOT WORKING

In SQL Developer, do you ever face issue while running some test oracle script like below and want to see the dbms output..?  and you don't see the dbms output.. DECLARE    l_name   VARCHAR2 (50) := 'Steven Feuerstein'; BEGIN    DBMS_OUTPUT.put_line ( TRANSLATE (l_name, 'e', '2')); END; Then here is what you got to do .. just add the below snippet on the top and now you should see the dbms output : set serveroutput on format wraped;