Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Unable to navigate URL in Safari using web driver through C# #4271

Closed
lukeis opened this issue Mar 3, 2016 · 21 comments
Closed

Unable to navigate URL in Safari using web driver through C# #4271

lukeis opened this issue Mar 3, 2016 · 21 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 3, 2016

Originally reported on Google Code with ID 4271

Hi, 

I completed Safari Developer Certificate Utility and added Safari Extension in Extension
Builder of Safari but still not able to invoke Safari Browser (V 5.1.4) using .NET
application. My application throws error "Object reference not set to an instance of
an object." when I create object of SafariDriver . It opens Safari browser but doesn't
navigate to URL. I am not sure this is bug or I am missing something.

I am using new version of Webdriver (2.24.0.0). I wrote below code to invoke Safari
browser.

   IWebDriver driver = new SafariDriver();
   driver.Navigate().GoToUrl("www.gmail.com");


What steps will reproduce the problem?
1. I am using Visual Studio 2008 .NET framework 3.5 on Windows XP 32 bit machine.
2. I downloaded code from http://selenium.googlecode.com/svn/trunk/ 
3. I executed command  $. /go safari’ in the terminal created a file ‘SafariDriver.safariextension’
in the path ‘/trunk/build/javascript/safari-driver/SafariDriver.safariextension’
4. I included in Safari browser under Extension Builder

Selenium version:2.24.0.0
OS:Windows XP
Browser:Safari 
Browser version: 5.1.4

Please help me.

Thanks & Regards,
Preeti

Reported by preeti.anasane on 2012-07-18 13:46:12

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

1) Always use fully specified URLs for navigation: "http://www.google.com", not "www.google.com".
 WebDriver's behavior is undefined for URLs that are not fully specified.

2) Please post the SafariDriver's logs, as outlined on the wiki:
http://code.google.com/p/selenium/wiki/SafariDriver#Reporting_Bugs

Reported by jmleyba on 2012-07-18 15:19:14

  • Status changed: NeedsClarification
  • Labels added: Component-WebDriver, Browser-Safari, OpSys-Windows
  • Labels removed: Status-Untriaged

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I tried with "http://www.google.com" URL, but webdriver having same behaviour.

Reported by preeti.anasane on 2012-07-19 11:06:47

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

What about the second item I posted?

Please post the SafariDriver's logs, as outlined on the wiki:
http://code.google.com/p/selenium/wiki/SafariDriver#Reporting_Bugs

Reported by jmleyba on 2012-07-19 16:08:35

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Also, including the stack trace from your .NET exception would be helpful. I've just
confirmed that using the 2.25 .NET bindings with the Safari extension compiled from
trunk works fine to navigate to Gmail, so there must be something in your environment
different from mine that's causing the issue.

Reported by james.h.evans.jr on 2012-07-19 17:42:02

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Thanks for your response James.
I am still facing issue but error has changed, when I took latest Webdriver dll of
framework 3.5. (V 2.25.1) and latest code from (http://selenium.googlecode.com/svn/tags/selenium-2.25.0).
Now it is throwing error (Did not receive a connection from the Safari extension. Please
verify that it is properly installed and is the proper version.). This works perfect
when I use RemoteWebdriver and runs Java Server from command 
prompt. But I want to use Webdriver object.
Please let me know if I am doing some wrong steps while creating Safari extension.

Steps:
1. I copied latest code from http://selenium.googlecode.com/svn/tags/selenium-2.25.0)

2. Build Extension from CMD using dos command "C:\Selenium_2_25>go safari"
3. Add extension in Safari browser as mentioned in documentation
4. Created C# .Net sample application in VS 2008 using Framework 3.5
5. Invokes Safari browser properly but throws error at the time of object creation

Attaching .NET trace file for your ref.

Reported by preeti.anasane on 2012-07-20 11:16:11


- _Attachment: [SeleniumStackTrace.txt](https://storage.googleapis.com/google-code-attachments/selenium/issue-4271/comment-5/SeleniumStackTrace.txt)_

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Again, you really need to provide us with the SafariDriver's browser logs.  The instructions
for how to get them are on the wiki page.  These logs will most likely tell us why
the SafariDriver isn't working for you.

Reported by jmleyba on 2012-07-20 16:03:08

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I am trying to navigate this URL:(http://www.linkedin.com). 
I also attached Console and Global Page LOG.

Attaching SafariDriver's Log.

Reported by preeti.anasane on 2012-07-21 12:06:44


- _Attachment: [SafariLog.txt](https://storage.googleapis.com/google-code-attachments/selenium/issue-4271/comment-7/SafariLog.txt)_

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Steel I am unable to proceed please help me.

Reported by preeti.anasane on 2012-07-28 10:03:45

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Hy I am also getting the same error and the browserlog is:

[WebDriverException: Did not receive a connection from the Safari extension. Please
verify that it is properly installed and is the proper version.]
   OpenQA.Selenium.Safari.SafariDriverCommandExecutor.Start() +214
   OpenQA.Selenium.Safari.SafariDriver.StartClient() +120
   OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities
desiredCapabilities) +58
   OpenQA.Selenium.Safari.SafariDriver..ctor() +76
   BroweserTest.Controllers.BrowseriaController.Browseria(List`1 BrowserType, String
SubmitUrl) in C:\Users\user\Documents\Visual Studio 2010\Projects\BroweserTest\BroweserTest\Controllers\BrowseriaController.cs:111
   lambda_method(Closure , ControllerBase , Object[] ) +227
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[]
parameters) +17
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext,
IDictionary`2 parameters) +208
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext,
ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter,
ActionExecutingContext preContext, Func`1 continuation) +263
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext
controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2
parameters) +191
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext,
String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext
requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _)
+12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult
result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+8967885
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
+184

Reported by amatyakrisha on 2012-09-25 05:31:44

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

please I need help on it ...............

Reported by amatyakrisha on 2012-09-25 05:32:20

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I'm facing the same issue. It's really frustrating :/

Reported by pgruszeczka on 2012-11-05 10:14:04

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016


I have installed the extensions as suggested.
Getting following error.
OS : Windows XP
Browser Safari 5.1
SeleniumTests.
SetUp : OpenQA.Selenium.WebDriverException : Did not receive a connection from the
Safari extension. Please verify that it is properly installed and is the proper version.
TearDown : System.NullReferenceException : Object reference not set to an instance
of an object.

Reported by pindikanti on 2012-11-06 15:19:10

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Hi All,
I need help on this. I am using C# and VS2010.
I installed safari and got the developer certificate. 
I download the uncompiled version of safari extension from web and added it to the
extension builder.  I installed the safari extension as directed in the web and built
the necessary package as well.  <<AM I MISSING ANYTHING HERE : Do I need to add this
extension to the selenium REFERENCES, if so how to do it?>>

In the meantime, I have ensured that the safaridriver initiation code is not throwing
any error messages. It is opening the browser and sending an urls after that. Help
me please. 

Reported by id4selenium on 2012-11-29 15:42:49

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Is this issue still actual?

Reported by barancev on 2013-05-16 20:29:43

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Is this issue still actual?

Reported by barancev on 2013-10-23 21:04:36

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Closing the issue due to inactivity, feel free to ask for reopening if it still can
be reproduced in latest Selenium version (2.37 at the moment)

Reported by barancev on 2013-11-02 19:51:02

  • Status changed: Fixed

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I'm having this issue. This should be reopened.

Safari v5.1.7
Selenium v2.37.0.0

IWebDriver driver = new OpenQA.Selenium.Safari.SafariDriver();
diver.Navigate().GoToUrl("http://www.google.com/");
driver.Quit();

08:15:35.55 [safaridriver.extension.Tab] [8qx4aeikwm2a] Tab may be ready; waiting for
idle state
08:14:43.92 [safaridriver.extension] Creating global session...
08:14:43.92 [safaridriver.extension.TabManager] Registering new tab
08:14:43.92 [safaridriver.extension.TabManager] Set command tab to fqrmxtmd67av
08:14:43.92 [safaridriver.extension] Creating debug driver...
08:14:43.92 [safaridriver.extension] Waiting for connect command...
08:14:45.20 [safaridriver.extension] Loading module(page_base)
08:14:45.21 [safaridriver.extension.Tab] [fqrmxtmd67av] Tab may be ready; waiting for
idle state
08:14:45.21 [safaridriver.inject] Content page has requested a WebDriver client connection
to ws://localhost:53433/wd
08:14:45.22 [safaridriver.extension.Server] [jreuqcuzu182] Attempting to connect to
ws://localhost:53433/wd
08:14:45.31 [safaridriver.extension.Tab] [fqrmxtmd67av] Tab looks ready; notifying
listeners
08:14:46.31 [safaridriver.extension.Server] [jreuqcuzu182] WebSocket connection was
closed.
08:14:46.31 [safaridriver.extension.Server] [jreuqcuzu182] Failed to connect to ws://localhost:53433/wd
08:14:46.81 [safaridriver.extension.Server] [jreuqcuzu182] Attempting to connect to
ws://localhost:53433/wd
08:14:56.00 [safaridriver.extension.Server] [jreuqcuzu182] WebSocket connection established.
08:14:56.00 [safaridriver.extension] Connected to client: ws://localhost:53433/wd
08:15:35.47 [safaridriver.extension.TabManager] Registering new tab
08:15:35.47 [safaridriver.extension.TabManager] Tab opened: 8qx4aeikwm2a
08:15:35.47 [safaridriver.extension.TabManager] Ignoring open window event
08:15:35.49 [safaridriver.extension.TabManager] Deleting entry for tab 8qx4aeikwm2a
08:15:35.51 [safaridriver.extension] Loading module(page_base)
08:15:35.55 [safaridriver.extension.Tab] [8qx4aeikwm2a] Tab may be ready; waiting for
idle state
08:15:35.57 [safaridriver.extension.Server] [jreuqcuzu182] Executing command: newSession
08:15:35.65 [safaridriver.extension.Tab] [8qx4aeikwm2a] Tab looks ready; notifying
listeners

Reported by matt.tycholaz on 2013-11-19 15:18:00

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Try to disable your ant-virus, that resolved the problem for me.

Reported by igor.horvat@codecons.com on 2013-12-12 14:58:36

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I have the same issue and I think I have identified the cause. I've opened a new ticket
for those how are still interested as this on is tagged as fixed :
[https://code.google.com/p/selenium/issues/detail?id=6860]

Reported by florentbr on 2014-01-18 03:02:53

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Issue 6701 has been merged into this issue.

Reported by james.h.evans.jr on 2014-01-21 18:43:45

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by luke.semerau on 2015-09-17 18:15:51

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 3, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant