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
http://www.c-sharpcorner.com/UploadFile/jawedmd/white-an-automation-framework-for-windows-application/
"or"
- And to know more about WaTin framework you can refer below link.
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;
/// <summary>
///Pass the Browser control from Watin to White
/// </summary>
class BrowserFocus
{
//Instance of Internet explorer using watin
readonly IE _browser = new IE();
/// <summary>
/// Method to open browser using watin
/// </summary>
public void AutomationUsingWaTin()
{
//open browser
_browser.GoTo(http://jawedm.blogspot.com);
_browser.WaitForComplete();
//call white method to pass control from watin to white
PerformActionUsingWhite();

Vikas MishraPosted Dec 10, 2011, 12:20 AM
well done Prashant, it's very nice explanation............
Michell JohnsonPosted Dec 9, 2011, 11:40 PM
Dear jawed it's a great effort for doing such task, it helps a lot thanks
Prashant ChaudharyPosted Dec 9, 2011, 4:09 AM
Good work