This is a migrated thread and some comments may be shown as answers.

Exception after LaunchNewBrowser() is called

8 Answers 226 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Xin
Top achievements
Rank 1
Xin asked on 15 Jan 2011, 08:17 AM

Hi all,

I am getting the following exception after LaunchNewBrowser() is called (IE does get launched):

   System.ApplicationException : Exception thrown attempting to launch Internet Explorer. Please make sure Internet Explorer is properly installed and you are able to launch it.
  ----> System.NullReferenceException : Object reference not set to an instance of an object.
   at ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.LaunchNewBrowserInstance(Int32 timeout, ProcessWindowStyle windowStyle, String pipename)
   at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)
   at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser()
   at YuntuMerchantUITest.YunTuAutomationBVT.AccountInfoBVT()
--NullReferenceException
   at ArtOfTest.Common.Win32.WindowManager.Attach(IntPtr& handle, Boolean findTabWindow, Boolean loadClr, IntPtr& hookId)
   at ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.LaunchNewBrowserInstance(Int32 timeout, ProcessWindowStyle windowStyle, String pipename)

I've seen similiar posts in the forum and have already done the following:
1. disabled UAC in server management tools
2. compile for x86.
3. loading the test dll using Nuit's x86 exe
4. change all IE security settings to align with the guide from WebAii.

Code:
Manager m = new Manager(false);
m.Start();
m.LaunchNewBrowser();

Environment:
IE8, version 8.0.7600.16385
Windows Server 2008 R2, 64bit

Same exact code runs perfectly fine my Win7 32bit machine. Same IE version and security settings. This leads me to believe it's a 32bit/64bit issue, however from TaskManager, the iexplorer.exe process has a *32 after it (which means it's a 32bit process).

Any insights? I am pretty much all out of ideas right now.

Thanks...
Xin

8 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 21 Jan 2011, 09:40 AM
Hi Xin,

I apologize for the delay getting back to you on this problem. It sounds like something is not getting initialized properly in your code. Can you send us your test project for analysis? Just put the entire folder into a .zip and attach it to your reply.

Best wishes,
Cody
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Xin
Top achievements
Rank 1
answered on 24 Jan 2011, 03:24 AM
Hi, thanks for getting back to me. Attaching the entire solution.

Thanks...
Xin
0
Cody
Telerik team
answered on 25 Jan 2011, 12:02 AM
Hello Xin,

I don't see our standard initialization being performed. I have attached a sample WebAii test designed to be run under NUnit. Please give this a try.

Regards,
Cody
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Xin
Top achievements
Rank 1
answered on 25 Jan 2011, 03:10 AM
Hi,

Thanks for your reply. I've added the init call in my code, however still getting back the same exact exception. Attaching the modified code.
0
Cody
Telerik team
answered on 28 Jan 2011, 12:32 AM
Hi Xin,

The project I received still did not include the necessary setup/tear down code. I also found I had to change the .NET target framework to .NET 3.5 from .NET 4.0 in order to be compatible with the NUnit runner.

Regards,
Cody
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Saket
Top achievements
Rank 1
answered on 20 Jan 2012, 07:02 AM
Hi,

I am facing the same issue, when i try run it by a adminstartor login it works well but when i chnage the login to the logged in user i get  a issue on launch browser 

  Code:
Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
  Error:
 
catch - launching browser


i have the tear down and clean up code in place..

Any clue as to why this is happening
the browser opnes but then gives the above exception

Thanks
0
Plamen
Telerik team
answered on 20 Jan 2012, 04:50 PM
Hello Saket,

How you are running your test? I assume you are running the test in Visual Studio. The problem is that our tool requires an administrator level access to function properly in VS2010. As seen in this article(first solution), you always need to run Visual Studio as Administrator in order to be able to launch the browser. Follow this link to see how you can do that.

Kind regards,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Saket
Top achievements
Rank 1
answered on 23 Jan 2012, 07:33 AM
thanks
Tags
General Discussions
Asked by
Xin
Top achievements
Rank 1
Answers by
Cody
Telerik team
Xin
Top achievements
Rank 1
Saket
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or