Tuesday 27 December 2011

Basic Interview Questions for Manual Testing By Saravanan on c-sharpcorner


Saravanan the author of above article on c-sharpcorner has nicely collected all the Basic Interview Questions of manual testing.

I would suggest the entire Manual tester to have a look or we should know all this basics of manual testing.

Below is the link of the article published by Saravanan on c-sharpcorner.

Please don’t forget providing your valuable feedback over there.

Thanks,
Md. jawed

.NET Interview Questions complied by Scott Hanselman


While surfing net I came across a fantastic blog. Thought to share with all of you!!
The author of this blog nicely listed out all the Questions being asked in interview or rather Great .net Developers Should know.

So here is the link to get the list of questions from .Net.


Let me know your view about the questions!!
Thanks,
Md. jawed

Tuesday 20 December 2011

Are you Confuse between Abstract class and interface?

If you are unable to find out, when to use abstract class and interface. Then here is the solution of your problem. I found very useful article on Abstract class and interface. The author “Rahman Mahmoodi” has explained the things in very nice way.


Before going through this article even I was not having clear picture of abstract class and interface.

But now I’m clear about abstract class and interface.

I would suggest all of you to at least once go through this article. And fold back your shelve to learn Abstract class and interface.

Link provided below.

http://www.codeproject.com/KB/cs/abstractsvsinterfaces.aspx

And don’t forget providing your feedback or comments below this article.
Thanks,
Md. Jawed

Friday 16 December 2011

Dynamically Find controls Type used in web application using WaTin

Introduction:
Using this WaTin feature user would be able to get all the controls types dynamically used in web page.
Details:
  
While performing automation so many times we have faced the issues to find the control type on fly and perform some basic operation or get the properties of controls.


Let me give an example to explain this with clear picture.

Suppose that developer has placed a table on webpage. This table would contents many controls like textbox, button, picture box, label, dropdown, list etc. etc. all this control would appear in table cells dynamically, it means we are not sure when and at what position of cells it will appear in table.

Now we have to read this control on fly and performed some basic operation.

So being an automation engineer, we have programmed our automation code in such a way to know about this control and where it has appeared then performed operation or read properties of that control.

Its bit tricky to handle this kind of situation.

To solve this kind of issues WaTin have provided one best feature to get the type of controls and then based on control we can call our custom method to either get the properties or performed common action.

Here I will only show to how to read controls types on FLY using WaTin.

Below is the Image of web page (to automate this scenario I have developed one basic web application)

And here is the piece of the code to the same.

try

{
IE ie = IE.AttachTo<IE>(Find.ByUrl("http://localhost:28348/Home.aspx"));
var tablecells = ie.Table("table").TableCells;
var type = new string[tablecells.Count];
int i = 0;
    foreach (TableCell tableCell in tablecells)
    {
      try
       {
          string watinType = tableCell.Elements[0].GetType().FullName;
          if (watinType != null) type[i] = watinType.Split('.')[2];
       }
       catch (Exception)
       {
           throw;
        }
    i++;
    }
}
Catch (Exception)
{
throw;
}

And below is the Result when you run the above piece of code. You can see all the controls type in the Type array of string. Shown in below drop down.
Feel free to provide your valuable comments and suggestion.


Thanks,
Md. Jawed

Wednesday 14 December 2011

Perform action on web application using White framework

Introduction:
Using this user would be able to transfer control from WaTiN framework to White Framework to perform action on target web site which is not provided by WaTin.
you can also read this post on http://www.c-sharpcorner.com/UploadFile/jawedmd/perform-action-on-web-application-using-white-framework/

Details:
Before explain this Article/tips I assume that reader is well aware with WaTiN and White Framework (refer below link to get roll your eyes with WaTin and White framework).

Being automation engineering sometimes while automating web application we have to passes the browser control from one framework to another framework to perform some additional action/task on target application.

Okay so let's talk about some real time scenario.

To automate web application I highly concentrated on WaTin framework, as I'm good in that.But sometimes I have to pass browser control from WaTin to White (framework for Windows application) to get focus of open browser or to bring the Browser on User Focus and/or user wants to Click at some particular coordination of browser for that the white framework is much comfortable doing this.

• To know more about White you can refer my link posted on this site
    Click Here
       "or"
  http://white.codeplex.com/

• And to know more about WaTin framework you can refer below link.
   http://watin.org/

okay so now come to the coding part,To achieve this below is the piece of code doing the same?.

I have commented each lines of the code to get clear picture about logic of the code written. And I think rest of things is self-explanatory.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WatiN.Core;
using WatiN.Core.Logging;
using WatiN.Core.Native.Windows;
using White.Core;
using White.Core.UIItems;
///
///Pass the Browser control from Watin to White
///

class BrowserFocus
{
//Instance of Internet explorer using watin
readonly IE _browser = new IE();
///
/// Method to open browser using watin
///

public void AutomationUsingWaTin()
{
//open browser
_browser.GoTo(http://jawedm.blogspot.com);
_browser.WaitForComplete();
//call white method to pass control from watin to white
PerformActionUsingWhite();

}
///
/// Perform Operation on Web application using White, by passing control from WaTin To White
///

private void PerformActionUsingWhite()
{
try
{
//Get the application from watin using processId
var app = White.Core.Application.Attach(_browser.ProcessID);
//get the open browser by watin for white
var windows = app.GetWindows();
White.Core.UIItems.WindowItems.Window window;
//check whether its having browser control or not
if (windows.Count == 1)
{
window = windows[0];
}
else
{//get the browser control using desktop instance
window = White.Core.Desktop.Instance.Windows().Find(w => w.Title.Contains(_browser.Title));
}
//bring the focus on Browser using white
window.Focus();
//Coordination of point where we want to perform right click
var point = new System.Windows.Point(400, 500);
//Right click on the browser using white.
window.RightClickAt(point);
}
catch (Exception ex)
{
// This happens when one of the open windows doea not respond.
// Logger.TraceException("White caused an exception", ex);
}
}
}

Feel Free to provide you valuable feedback and suggestion.

Thursday 1 December 2011

System EVENLOG for logging

if you are planning to use system even viewer for loging purpose. then,below piece of code will work for you!!

if(System.Diagnostics.EventLog.SourceExists("Application"))
   {
     this.eventLog.Source = "Application";
     this.eventLog.Log = "Application";
     this.eventLog.WriteEntry("This is Warning for evenlog!!", EventLogEntryType.Warning);
     this.eventLog.WriteEntry("This is Information for evenlog!!", EventLogEntryType.Information);
     this.eventLog.WriteEntry("This is Error for evenlog!!", EventLogEntryType.Error);
   }

below is the screen shot from event viewer with logging details.


Thanks,
Md. jawed