Desperately trying to make Watin work with IE - timeout

I have been working with Watin for about 1 week. I really wanted to make firefox work but had to give up after a day or so when seeing there was no way i could get jSSH working with Firefox 8 etc. Really wish there was a way of using Chrome or firefox i have to say
So returning reluctantly to IE I developed some automation software using Watin, however I have a persistent problem with Goto(href) where it seems as though the page never actually gets marked as complete. And although the browser navigates to the page and I can see the page fine, the call to Goto() just times out. After that point anything I try fails and it cant find the elements in the dom and I cant click anything programmatically. So I have to solve this timeout issue
I have read various articles suggesting fixes and have tried them all as far as I can see i.e. making sure I run as administrator, making sure that internet explorer enhanced security is switched off, etc.. I would really, really like to make Watin work - but right now I am about ready to give up and create a much, much simpler class with an embedded browser in my app. So stackoverflow is my last port of call. How can I stop Watin from timing out.
I am on Windows 7 Ultimate Version 6.1.7601 Service pack 1 build 7601
Visual Studio 2010
compiling as a .net 4.0 app
IE 9.0.8112.16421 with update KB2586448
I have a console app, no threads, [STAThread] on my Main entry point
This is my Visual Studio info:-
Microsoft Visual Studio 2010 Version 10.0.40219.1 SP1Rel
Microsoft .NET Framework Version 4.0.30319 SP1Rel
Microsoft Visual C# 2010 01021-532-2002102-70185
Any help will be very greatfully received.
Regards Julian

ok, so after many months of playing and fiddling the answer to my question has several parts.
Firstly. I needed to get Watin working properly as an embedded browser in a win32 application rather than as a console app. This required me to spend a huge amount of effort getting Watin embedded the way I wanted, I had problems with STATHREAD (of course), and the pop up dialog watcher, and getting the HWND of my browser into Watin to create its browser object (I used another sample on stack overflow to do this) and then I had to ensure ScriptErrorsSuppressed=true and I finally got it working. Hoorah
However, the problem I originally had all that time ago still seems to remain with Watin.2.1.0.1196 in dealing with frame sets on asda.com.
So I have just now done a svn checkout of the watin project and I am finally hoping that the latest updates I have seen will fix this problem once and for all... and Yes I am still really looking forward to Jeroen getting IE9 or indeed any other browser working with Watin. Working with IE (any flavour) sucks

WaTiN does not support IE9 fully yet as far as I know. Jeroen (the creator) is working on getting it fully compatible with IE9, but IE9 relies on new WPF components in regards to previous versions of IE, so i'm guessing this will take some work.
We suffered from several problems as well when we upgraded our WatiN tests to IE9. In the end we force our website to render everything to IE8 standards and set IE9 to IE8 rendering mode untill there is an update from watin to fully support IE9 with all its quirkcs and features.

Related

Ranorex only tracks dom elements in IE

I've recently began to work with Ranorex and already got Firefox and Chrome working. Internet Explorer only seems to track dom elements for me. I don't get the usual elements I get in other browsers thus I can't track or run any tests.
I've already tried to reinstall ranorex, restart the computer, trying to deactivate security-features in IE and setting a few different ranorex settings.
I've tried ranorex 6.1 and 6.2.0 and for Internet explorer I am using the most recent version. Windows 7 64 bit.
I would love to hear any suggestions which I could still try to get it to run.
Thank you,
Christopher
Have you tried to turn off the Protected mode and the enhanced protected mode?

Win8 Metro IE10 Drag-N-Drop / Slider Issue

I was trying some slider / drag-n-drop demos of JQuery Mobile, Kendo UI and other javascript frameworks, but none seem to work in the Metro version of IE10 on my tablet (running Windows 8 Consumer Preview).
I remember there was a similar issue on IOS, but using most frameworks it's now working on my iPad.
Does anyone know how to solve this problem?
Is there any JS framework that has addressed this issue?
Could this be something that is still to be fixed by Microsoft before final release of Win8?
Cheers,
Ray
Internet Explorer 10 has a more abstact event model when it comes to touch, mouse, or pen events. Rather than having events like touchstart or mousedown, Internet Explorer 10 has an arguably superior model consisting of a much simpler MSPointerDown which is fired for all types of inputs, including fingers, mice, or pens.
Unfortunately, as you've noticed, there isn't a great deal of support in popular libraries and frameworks, though I suspect there are a few good reasons why this is the case:
IE10 is still technically incomplete.
IE10 is currently not available on Windows 7 (though it will be released on Windows 7 eventually)
IE10 currently requires the installation of unfinalized versions of Windows 8
These reasons, among more I'm sure, have likely caused the developers behind major frameworks and libraries to hold off on any serious investment of their time to target the new browser from Microsoft. That being said, I do know personally of some very key players from the jQuery project who have been keeping a close eye on Microsoft's new pointer model. I suspect the same can be said for other teams.
The reason is that IE10 introduces MSPointerEvents, which are probably not well supported by most frameworks, at least yet.
Update: Kendo UI supports MSPointerEvents since Q3 2012. As of Q1 2013 all framework widgets also work properly in IE10 when content is pinch-zoomed.

Questions on backwards compatibility of Firefox Addons/Extensions

Background info:
Over the past week, I have been messing around with Chrome extensions and had no problem creating my extension. Great, Chrome rocks for making the development process very easy to learn, and, well... just easy!
Now I have it in my mind that I'd like to create this extension for as many browsers as I can, so I decided on Firefox next.
What a mess! There documentation has done nothing but give me a headache and waste my time so far, VERY convoluted and just generally unorganized.
I have managed to locate a code sample for a simple extension that I think I can use as a starting point and have begun messing around with - fine...
I have learned that this sample extension will not work with anything less than Firefox 4, as it uses the bootstrap technique to make the extension installable without a browser restart. Ughhhhhh....
Now we arrive at my questions:
Is it possible to develop an extension for Firefox 7 that will work with previous versions of Firefox? I don't even care about anything prior to Firefox 4, if that's the cutoff point for restart-less installations. It would be nice to know that what I am spending all this time making will work consistently and for more than a week when the user is prompted to upgrade next.
How about the reverse? Can I create an extension that is compatible with Firefox 3.5 through Firefox 7? I realize it would require a restart to install, but that would be acceptable if it resulted in a working extension regardless of the version.
Can anyone with experience on this stuff share a bit of what I'm getting myself into here? It seems like this is a nightmare of a platform to develop on, and that I will be constantly fixing my extension.
One last piece of relevant information:
The extension I am developing is purely javascript based - this stuff should work (I think?) because it's dependent on just one feature "content scripts" that really shouldn't be changing in implementation between versions at this point... right?
So what exactly am I missing? How do you create easily manageable Firefox extensions that will work in all versions of the browser?
Thanks everyone! :)
You have to distinguish between "traditional" extensions and extensions built with the Add-on SDK. The former are far more powerful given that they have direct access to all APIs the browser uses - but that's also the reason why they are more complicated to write and why the documentation is rather unordered (there are simply very many things that you could do, far more than you could with Chrome). They are also more likely to break as the browser changes. The Add-on SDK on the other hand gives you a limited API much like Chrome. The Add-on SDK currently supports everything from Firefox 4 onwards (yes, because of restartless installation), with the promise that browser changes will merely require your add-on to be recompiled with a newer version of the Add-on SDK. In fact, that recompiling will likely happen automatically in future for add-ons hosted on addons.mozilla.org. On to your questions:
Is it possible to develop an extension for Firefox 7 that will work with previous versions of Firefox?
Sure it is. The Add-on SDK currently marks your add-on as compatible with anything between Firefox 4 Beta 7 and Firefox 8 Alpha 1. Even as traditional add-ons go - starting with Firefox 4 the differences between particular browser versions are rather small, most things work in all of them. You can also stay compatible with Firefox 3.x but depending on what you do it might require some effort. Important information:
Firefox 4 for developers
Firefox 5 for developers
Firefox 6 for developers
Firefox 7 for developers
How about the reverse? Can I create an extension that is compatible with Firefox 3.5 through Firefox 7?
It doesn't matter which way you go. I wouldn't recommend spending much time on Firefox 3.x support however. With Firefox 3.5 no longer supported the only relevant version is Firefox 3.6. According to the statistics of my add-ons roughly 18% of the Firefox users continue using it. In the next few months this percentage will get significantly smaller, especially when Mozilla announces end-of-life for this branch. So for a new add-on supporting it is usually not justified.
Can anyone with experience on this stuff share a bit of what I'm getting myself into here?
Depends on how complicated your add-on will be. Given that you are developing an equivalent to a Chrome extension, you will most likely be using the Add-on SDK which means that there won't be any compatibility problems. As traditional add-ons go, simple add-ons that don't rely on some obscure implementation details also typically don't have any trouble staying compatible (I have two add-ons that didn't need a single adjustment since Firefox 3.5). Add-ons that go deep down into the system are more problematic of course.

Cassini stops responding when debugging stops

When developing WebForms web site, I start my project once, Cassini loads and stays loaded until I kill it. Therefore, when I change something (it recompiles in background), and refresh in browser is all it takes to see the changes.
But with MVC, I have to start debugging every time because Cassini is not responding to requests if debugging is not running.
Is it possible to get the same Cassini behavior in MVC as in WebForms?
It isn't usual for this behaviour, even when developing MVC websites. I am able to make changes to non-compiled stuff (aspx,ascx) etc and it'll take effect immediately on refresh. Changing classes will require you to stop debugging so that you can re-compile, and allow breakpoints to work correctly.
Also, whilst isn't strictly an answer to your question, you should strongly consider moving away from the baked-in Cassini web server used when debugging.
For more information on my general hatred of Cassini, please read this previous question.
If you're unable to either install IIS on your machine (because it might be XP Home or whatever), then you should consider either upgrading to XP Professional (where you are limited to running one website only), or Windows Vista, or Windows 7 RC where you can use IIS7 and all the greatness that it provides.
If you can't do any of those, you should consider trying an alternative, such as Ultidev.
I think I found the solution - the trick is to Run project wihout debugging. There is no item for it in Build menu, but keyboard shortcut works (Ctrl+F5 in Visual Basic keyboard scheme).
Cassini starts and remains responsive regardless of debug mode.

How to embed a browser object, other than IE<n>, in a Delphi application

Using the default TWebBrowser makes things easy to embed a web browser. Unfortunately the one that comes in by default is IE<n>.
I'm wondering how does one integrate a Gecko or WebKit one.
Are there VCL examples somewhere?
If not, how would one go about doing it?
Where's the best place to find the core for Gecko and/or WebKit in an embeddable format?
TWebBrowser is IE. It is not a plugable construction for browsers. You can have other browsers integrated in your application. See
http://www.adamlock.com/mozilla/
http://delphi.mozdev.org/articles/taming_the_lizard_with_delphi.html
http://ftp.newbielabs.com/Delphi%20Gecko%20SDK/
Time has moved on
This answer is from '08 and since then time has moved on. The links don't work anymore and there are probably better alternatives now.
A viable alternative is CEF - Chromium Embedded Framework which encapsulates the Chromium browser which by itself encapsulates WebKit. This library is provided as plain DLLs with an exported C API.
There's a delphi interface available at code.google.com/p/delphichromiumembedded
I've been using it with my own interface implementation and works great, though not so easy to properly use as THTML or IE, but great for whoever needs a powerful and embeddable browser.
Edit: Lars beat me to it, unfortunately
Well there is an ActiveX control based on the Gecko engine that tries to present an exact copy of the IWebBrowser API (which TWebBrowser uses).
You can find it here: http://www.iol.ie/~locka/mozilla/control.htm
Unfortunately it looks like it hasn't been updated in a while. The last version is based on Gecko 1.7.12 and I believe Gecko is currently up to 1.9.x (used in Firefox 3)
An alternative is THTMLViewer component. I have used this for some years.
This is now available free. the web siteis here http://pbear.com/htmlviewers.html. According to the songbeamer web site (http://www.songbeamer.com/delphi/) there is a Delphi 2009 version available.
Over the last three years I have come across very little in the way of embedding Gecko in Delphi. One library that showed up fairly late in the game (for me) was the GeckoSDK project on SourceForge. I did a lot of work early on trying to make embedded Gecko work correctly in Delphi. Our first attempt at a Gecko rendering engine based internal "browser" was built using Delphi and Gecko 1.8. We have since moved on and our browser is now a XULRunner application. I have pieces of code laying around on my hard drive yet from that early attempt that I have not deleted yet.
When Mozilla releases Gecko 2.0 I think it will become a lot easier to embed in Delphi. The XPCOM object system in Gecko makes it very difficult to embed because most everything returns an NS_RESULT. Strings especially were hard.
edit: I just looked through my old bookmarks (almost all of which are dead) and searched for a new url for the Japanese language "bagel" browser based on Gecko and found it here,
http://github.com/plus7/bagel/tree/master/Legacy.
This is probably your best bet for some excellent code to start from. Unfortunately the comments in the code are Japanese and the author never responded to questions.

Resources