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

Why never get fixed Win2008 R2 X64 IE lauch issue

3 Answers 17 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
J
Top achievements
Rank 1
J asked on 18 Jan 2014, 08:12 AM
Trouble shooting for several days, with reflector I found the real cause.

The problem is under Environment:
Windows Server 2008 R2 x64, IE 9, IE10 and IE12, and every version of Testing framework from 2012.2 to lastest.
IE would not launch, always prompting could not find file. I tried ways from every posts which is similar but get no way.

Then I had to use reflector and found the following code never works in my environment:

ProcessStartInfo startInfo = new ProcessStartInfo {
            Arguments = ((MajorVersion >= 8) ? "-nomerge " : string.Empty) + "about:blank",
            Verb = "open",
            WindowStyle = windowStyle,
            ErrorDialog = false,
            FileName = "iexplore.exe"
        };
        Process process = Process.Start(startInfo);

which resides in LaunchNewBrowserInstance(int timeout, ProcessWindowStyle windowStyle, string pipename), the above code always throwing exception.
System.ComponentModel.Win32Exception (0x80004005): 系统找不到指定的文件(System could not find specified file)。
   在 System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startI
nfo)
   在 System.Diagnostics.Process.Start(ProcessStartInfo startInfo)

The correct way is using :

Process.Start(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), @"Internet Explorer\iexplore.exe"));
and
Process.Start(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"Internet Explorer\iexplore.exe"));

for replacement.

Could you guys fix this for this environment, thanks a lot. It confused me for quite a long time.

Thanks!

3 Answers, 1 is accepted

Sort by
0
Velin Koychev
Telerik team
answered on 23 Jan 2014, 11:19 AM
Hi J,

Thank you for your feedback and sharing with us your discoveries.

Could you please send us a sample test project where you experience this issue. We will try to reproduce it locally on a similar environment and fix it.

Thank you for your cooperation.

Regards,
Velin Koychev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
J
Top achievements
Rank 1
answered on 23 Jan 2014, 05:10 PM
Any simple line of launch browser won't work.

I've found work around for this issue is to add IE folder under program files to PATH environment variable, this would make it successfully finding iexplore which in your code does not specify abosulte path in Process.Start.
0
Velin Koychev
Telerik team
answered on 28 Jan 2014, 11:15 AM
Hi J,

Unfortunately I am not able to reproduce this issue against Windows Server 2008 R2 Enterprise.

I tried using the following code and it works perfectly: 
[TestMethod]
        [Description("My simple demo")]
        public void SimpleTest()
        {
            // Launch an instance of the browser
            Manager.LaunchNewBrowser();
 
            // Navigate to google.com
            ActiveBrowser.NavigateTo("http://www.google.com");
 
            // verify the title is actually Google.
            Assert.AreEqual("Google", ActiveBrowser.Find.ByTagIndex("title", 0).InnerText);
        }

I also recorded a short video for demonstration. 

Let me know if I am doing something different than you. 

Regards,
Velin Koychev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
J
Top achievements
Rank 1
Answers by
Velin Koychev
Telerik team
J
Top achievements
Rank 1
Share this question
or