How to catch an opened Coded UI browser session with watIN? - watin

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.

Same basic answer as here: How to use WebAii and WatiN with Same Browser
Open browser via coded UI
do stuff with coded UI
attach to browser
in WatiN using .AttachTo() do stuff with WatiN
More on browser attachto is here: http://watinandmore.blogspot.com/2010/01/browserattachto-and-iattachto.html

Related

IE11 losing session or cookie info after window.open

Here's my problem
I have a website(X1.com) which contains a login and a button(window.open) after login to open another app (X2.com) in a detached window.
this X2.com has list of items and when I double click an item it is supposed to open X1.com/item1.
All of this was working as expected when I was using IE9, chrome and firefox.
But when updated my IE9 to IE11 double clicking the item on X2.com is taking to the login page of X1.com saying session timed out. Chrome still works fine. When I close/logout and login again to X1.com keeping X2.com window open X2.com is able to open that X1.com/item1 page properly.
Is there an internet option or security setting or a plugin in IE that's blocking X2.com from opening X1.com/item1 page first time?
My company uses IE11 only for operations and that's why I have to get it working. Please ask if my question is not clear. I can provide the exact urls if required.
It's a common issue in IE11, as a workaround add registry entry of value 0 at:
HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/Main/TabProcGrowth

Watir Selenium see if ajax request made

Is there any way in Watir to check if a ajax call is made?
I mean when testing manually the tester would open Firebug or an equivalent program and check under the network tab and see that the request appears there.
How could this be automated using Watir?

Custom Web Browser - To Load only my URL - Firefox

I need a Portable web Browser, or any install-able (Windows) Browser, which will only load my URL.
Some thing Like I will have my Shortcut in the desktop, when User click, the Web browser with my URL loads.
Is it possible with portable Firefox to modify, I also need cookies to work along, thats the reason I need to find a custom Web browser.
I just found out a partial solution using
Mozilla Client Customization Kit , we can create a extension which allows to customize firefox upto certain limitations.
https://addons.mozilla.org/en-US/firefox/addon/cck/

Run Capybara without opening browser

I wrote simple console script for scraping with capybara (selenium driver) but doesn't want browser to appear. I just wan't text to be written on console.
Is possible to run capybara wihout opening browser?
There is a headless-webkit driver for Capybara that would avoid opening a browser window.
If you are not tied to the Capybara API and don't need to worry about JavaScript then mechanize would probably be a simpler way to interact with Web sites.

CefSharp - How to handle "This page has insecure content." message?

I am using the CefSharp .Net wrapper for the Chromium Embedded Framework as a simple wrapper around a web application. In my web application, I make a JSONP AJAX call out to another domain to get some data and display it. The URL to that domain is not using SSL. Because of that, when doing this in the Chrome browser, I get the following message, to which the end user would simply click "Load Anyway", allowing the JSONP request to fire and the data to be retrieved...
The app using CefSharp simply starts up the main URL to my web application when it runs. When I try and make the same call in my this application using CefSharp, however, it doesn't get that same prompt. Instead, the AJAX request just times out (the same behavior that happens when the end user never clicks a button in the yellow bar that appears in Chrome).
Does anyone know if CefSharp has a way for me to catch this security message and either...
Prompt the end user to click "Load anyway", similar to the behavior of the Chrome browser, or
Programmatically bypass the security warning altogether?
If not, does the Chromium Framework itself support dealing with this situation?
After posting to CefSharp and CEF projects, it looks like CEF does not currently support this situation. magreenblatt suggested a couple of approaches to add it to CEF. Now I just need to try and find the time to add support for it. :-)

Resources