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

Safari tests not running - Safari executable path not found in registry

4 Answers 36 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 13 Apr 2012, 03:22 AM
Hi,

I have just installed the latest version of Test Studio Express (2012.1.411.0) and Safari (5.1.5). When we try to run a test via Qucik Execute Safari will launch and run through the test as expected. But when we generate the code and try to run the test via NUnit we get the following exception:

System.IO.FileNotFoundException : Safari executable path not found in registry
at ArtOfTest.WebAii.BrowserSpecialized.Safari.SafariActions.LaunchNewBrowserInstanceInt(Int32 timeout, String remotedUrl, ProcessWindowStyle windowStyle, Manager manager)
at ArtOfTest.WebAii.BrowserSpecialized.Safari.SafariActions.LaunchNewBrowserInstance(Int32 timeout, String remotedUrl, ProcessWindowStyle windowStyle, Manager manager)
at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)
at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle)
at Cecil.SharePoint.Foundation.UITests.CanCreateCourseForStaffUnitTest.CanCreateCourseForStaff(BrowserType browser) in CanCreateCourseForStaffUnitTest.cs: line 78 

I've had a look through the forum, but I can't find anything on this. Do you know what registry key we need to set?


Craig

4 Answers, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 13 Apr 2012, 04:34 PM
Hello Craig,

I tested this with a basic NUnit test against Bing.com and it executed successfully in Safari:

[Test]
public void SafariTest()
{
    Manager.LaunchNewBrowser(BrowserType.Safari);
    ActiveBrowser.NavigateTo("http://bing.com");
    HtmlAnchor a = Find.ByContent<HtmlAnchor>("Images");
    a.Click();
 
    System.Threading.Thread.Sleep(2000);
}

Does this work for you? Does your test work in other browsers? Please provide the code you're using so I can construct a similar test; I'm particularly interested in the code at line 78. Please indicate in your sample which line corresponds to line 78.

Kind regards,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Craig
Top achievements
Rank 1
answered on 17 Apr 2012, 02:20 AM
Hi Anthony,

I have tried the example you sent and I get the exact same error. The line that it is failing on is Manager.LaunchNewBrowser().

The code that we have is very similar, but it was auto-generated from Test Studio Express and points to an internal site so you won't be able to run it.


Craig
0
Craig
Top achievements
Rank 1
answered on 17 Apr 2012, 02:42 AM
Hi Anthony,

Further to this I had a poke around in the code and I managed to find out what the registry settings should be. They are:
[HKEY_LOCAL_MACHINE\SOFTWARE\Apple Computer, Inc.\Safari]
"Version"="5.33"
"BrowserExe"="\"C:\\Program Files (x86)\\Safari\\Safari.exe\""

I'm not sure why this isn't on my machines (I've checked three of them and none of them have this key!)


Craig
0
Anthony
Telerik team
answered on 17 Apr 2012, 03:57 PM
Hello Craig,

I have those keys in my registry at the following path:
  • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apple Computer, Inc.\Safari

See the attached screen shot for more detail. I can't explain why those keys aren't on your machine, and my only ideas are to either reinstall Safari or add the keys manually.

Greetings,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Craig
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Craig
Top achievements
Rank 1
Share this question
or