0

I'm working with Coded UI but found many issues trying to recognize many of the site components. So I'm trying with watIN but need to catch the already opened browser session in CodedUI, in watIN so I can start looking up for the site components.

i.e: This is the way I open a browser session when working with CodedUI

HtmlDocument browser = LoginScreen.NavigateToLogin(Url);

This just loads the URL -> BrowserWindow.Launch(url) and returns the HtmlDocument already logged in the system I'm using the CodedUIExtention (http://www.incyclesoftware.com/2013/03/build-a-coded-ui-test-without-a-ui-map/) to avoid using UImaps.

Now I need to catch that opened browser session with watIN instead of opening a new watIN session, that will cause all progress to get lost and open a watIN session from the very beginning is not an option.

jp06
  • 3
  • 2

1 Answers1

0

Same basic answer as here: How to use WebAii and WatiN with Same Browser

  1. Open browser via coded UI
  2. do stuff with coded UI
  3. attach to browser
  4. in WatiN using .AttachTo() do stuff with WatiN

More on browser attachto is here: http://watinandmore.blogspot.com/2010/01/browserattachto-and-iattachto.html

Community
  • 1
  • 1
OCary
  • 3,231
  • 2
  • 16
  • 17
  • Thanks! Actually from the very first time I was trying this: WatiN.Core.Browser.AttachTo(Find.ByUrl(active Url)); but rare thing was it wasn't working. At the end it turns out that inside the interop dll there is this parameter "Embed Interop Types" that is mean to be set as false, but by default was set as true. Once I changed it to false, the attachTo functionality worked just right. – jp06 Jan 04 '14 at 21:52