apiad / sublime-browser-integration

A Sublime Text 3 plugin for interacting with the browser and do developer related tasks.
MIT License
35 stars 2 forks source link

Couldn't make it work with Chrome 33. #2

Open politicus opened 10 years ago

politicus commented 10 years ago

Checked Google WebDriver was in my path (/usr/bin/). Checked that the plugin was installed in my Sublime 3 plugin folder (/Users/user/Library/Application Support/Sublime Text 3/Packages).

Launched ST3, fired some keyboard shortcuts, nothing happened.

What did i do wrong?

apiad commented 10 years ago

I'll check it out. In the meantime, could you please open your Sublime Text 3 console and tell me if you see any selenium related exceptions? It would be of great help.

Thanks a lot for trying it out and filing the issue. Testing is certainly very initial right now, something I want to improve for the future.

politicus commented 10 years ago

I just created a simple HTML file. Open the file with Chrome, tried to refresh to refresh the page with the shortcut. Just got a "no command for selector: noop:" answer.

apiad commented 10 years ago

Just a quick checklist, maybe all of this is evident, but anyway:

Thanks a lot for all the effort, I really appreciate people getting involved like this.

politicus commented 10 years ago

Gave chromedriver executing permissions. Opened ST3, hit your shortcut, got the same error in the console.

apiad commented 10 years ago

Ok, I'll take a closer look. Have to download Chrome 33 first. I'll try to fix it as soon as possible.

apiad commented 10 years ago

I googled the message you got, and find a couple of other projects in Github having the same issues, and it came down to re-installing the plugin through Package Control. Perhaps, since you installed it directly from source, it got somehow broken? Would you mind deleting it and trying to re-install from Package Control, just to try? I'm sorry to bother you but right now I'm unable to reproduce your error, since I have to figure out how to install Chrome 33 without replacing my Chrome 31, which is the minimum version I want to support for the plugin. It appears that that error message is given by the Sublime infrastructure when it cannot find the plugin associated with a key-binding. Thanks.

politicus commented 10 years ago

I reinstalled the plugin vie Sublime Package Control but couldn't open Google Chrome...

apiad commented 10 years ago

Ok, I'll definitely look into it. Sorry for bothering you this much, and thanks again for all the help. You'll be the first to know when (and if) I can fix it ;)

apiad commented 10 years ago

Chasing the bug I found out that my whole selenium integration was dead wrong. It worked on my computer (as usual) because I have all the right things in the right places, but all relative imports failed when moved. So I changed all that, and I think it should be working now. I made a new release, but Package Control will take a while to update, so in the meantime, if you want, you can download directly from here and check. Cheers...

politicus commented 10 years ago

Still having "no command for selector: noop:"... So deleted the plugin I installed manually. Tried installing it via the package control and got this :

Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 73, in reload_plugin m = importlib.import_module(modulename) File "X/importlib/init.py", line 88, in import_module File "", line 1577, in _gcd_import File "", line 1558, in _find_and_load File "", line 1525, in _find_and_load_unlocked File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 671, in load_module exec(compile(source, source_path, 'exec'), mod.dict) File "browser_integration in /Users/User/Library/Application Support/Sublime Text 3/Installed Packages/Browser Integration.sublime-package", line 10, in File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 671, in load_module exec(compile(source, source_path, 'exec'), mod.dict) File "selenium in /Users/User/Library/Application Support/Sublime Text 3/Installed Packages/Browser Integration.sublime-package", line 15, in ImportError: No module named 'selenium'

Maybe I should try again in a few hours?

apiad commented 10 years ago

Yeah, I've seen it too. I tried to install it manually on someone else's computer and got the same issue. It seems that my patch for importing selenium locally doesn't work in all scenarios. The thing is, I have a local python library that I want to import from my plugins. It works on my machine, apparently, because I'm developing the plugin there so I have all source unzipped, and all relative imports work. However, when you download it, it stays zipped, so local imports don't work in there. I still have no idea how to fix this. It should work if you uninstall, then manually unzip the .sublime-package (it's actually a .zip file), and then copy it inside Packages/BrowserIntegration. In the end I want it to work from Package Control of course, so I'll be working on this all day long and see if I can come up with a solution.

I'll let you know of the progress. Sorry again for annoying you with this, but your feedback has been critical for finding this show stopper bug. Thanks !!! ;)

apiad commented 10 years ago

I made it work with ST3 on Windows, at least to the point where it doesn't complain with selenium. Right now I need to install a Chrome >= 31 en Windows to try if chromedriver works. (I usually don't develop Windows-related stuff, so my Windows arsenal is nearly deprecated). I issued a new release (0.1.4-alpha), and uploaded a packaged version. However, the Package Control might take a while to index the new version. When and if everything works, I'll close the issue.

If you would like to try it out, check the last release, and download the attachment. Good luck!

politicus commented 10 years ago

I tried to install the attachment. Still does not work. I am on Mountain Lion.

apiad commented 10 years ago

I'm working on an update, that will attempt to download the right version of chromedriver automatically, and place it on the right place. I'll upload it as soon as possible. Unfortunately I have no way to test it on OSX easily, I'll try to setup a vbox environment for that purpose alone, but i'll take me a while. Ufff, this is turning out to be harder than I expected, it works smooth on my machine (Ubuntu 13.10 x86 + Chrome 31), but it is increasingly harder to make it work on other architectures. Anyway, really really thanks again for trying, I'll let you know as soon as I publish the changes. I'm going to include a logging capability to try and get a better idea of what's going on on your installation.

apiad commented 10 years ago

The new update (v0.1.8) works correctly on Ubuntu 13.10 + Chrome 31 and Windows 8 + Chrome 32. Please let me know if it still doesn't work for you. Cheers.

politicus commented 10 years ago

Installed the last version manually. Moved chromedriver in the plugin folder (as resquested in the README file). Launched ST3, hit the shortcut -> "no command for selector: noop:" Had tried it before moving chromedriver -> "no command for selector: noop:"

Every time I launch ST3, if not already installed, it downloads chromedriver (in the Package folder)

apiad commented 10 years ago

Yes, it tries to download chromedriver, and place it in the Package folder. After that, it should work. If the README says otherwise, then the README is wrong, I'll go and correct it. It definitely works for Ubuntu 13.10 and Windows 8. However, I haven't been able to test it on OSX yet. The no command for selector: noop means that ST3 hasn't found the plugin, maybe because something is raising an exception on the plugin load. It hasn't even been able to look up for chromedriver yet. The only thing I can think of, is that once downloaded chromedriver, I try to run chmod a+x chromedriver. Perhaps this line fails in OSX (I thought is was a Unix anyway, so it should work). Or there is something else more obscure happening. If you wouldn't mind to send me whatever happens in the console after you open Sublime (it will be rather long, I guess, so best to send it by mail to alepiad@gmail.com), to see if I can figure out what's going on. Its really a shame that it hasn't worked for you yet (and whoever else is trying to run this on OSX), I thought it would be solver by now. A million thanks again...!!

zsszatmari commented 10 years ago

Hi!

I have the same problem, but I am not sure it's the same cause. Basically I can't do anything, for example, launch browser. When I try, I get:

[Start] Browser Integration :: Opening new Chrome instance. Exception in thread Thread-30: Traceback (most recent call last): File "selenium.webdriver.chrome.service in /Users/zsszatmari/Library/Application Support/Sublime Text 3/Installed Packages/Browser Integration.sublime-package", line 63, in start File "X/subprocess.py", line 818, in init File "X/subprocess.py", line 1416, in _execute_child NotADirectoryError: [Errno 20] Not a directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "X/threading.py", line 639, in _bootstrap_inner File "X/threading.py", line 596, in run File "browser_integration_launch in /Users/zsszatmari/Library/Application Support/Sublime Text 3/Installed Packages/Browser Integration.sublime-package", line 28, in open_browser File "browser in /Users/zsszatmari/Library/Application Support/Sublime Text 3/Installed Packages/Browser Integration.sublime-package", line 27, in connect File "selenium.webdriver.chrome.webdriver in /Users/zsszatmari/Library/Application Support/Sublime Text 3/Installed Packages/Browser Integration.sublime-package", line 59, in init File "selenium.webdriver.chrome.service in /Users/zsszatmari/Library/Application Support/Sublime Text 3/Installed Packages/Browser Integration.sublime-package", line 68, in start selenium.common.exceptions.WebDriverException: Message: 'ChromeDriver executable needs to be available in the path. Please download from http://chromedriver.storage.googleapis.com/index.html and read up at http://code.google.com/p/selenium/wiki/ChromeDriver'

[End] Browser Integration :: Opening new Chrome instance.

chromedriver is in place: Found chromedriver executable in '/Users/zsszatmari/Library/Application Support/Sublime Text 3/Installed Packages/chromedriver' reloading Packages/User/Preferences.sublime-settings found 1 files for base name Default.sublime-theme theme loaded

Tried to run chromedriver manually, with success (it has +x flag) Tried to copy it to /usr/bin, browser-integration still not working. I'd be glad to answer any diagnostic question. Using OS X Mavericks, Chrome 34.0.1847.137, ST3, installed browser-integration via package manager. Thanks!

apiad commented 10 years ago

Hi, Thanks for sharing!

It took me a while to answer, its been a while since I last updated this project, but I want to take a dive into it once more, to fix some remaining issues and adding new features. I never really got the plugin cleanly working when installed through Package Control. I think the issue is because plugins installed that way are kept (and run) inside a zipped file, and the code that searches for and opens some files breaks, as well as basically all code that depends on paths.

I know this is a lot to ask, but if you could you please try to download it directly from github, and unzip it into your Packages folder, instead of directly installing it from Package Control, just to see if the issue is with file paths or with chromedriver really? Of course, you should first uninstall it from within Package Control. You could also try to launch Firefox instead, since it doesn't require an external driver. Firefox support is very very initial and hence buggy, but it might allow you to at least see the available commands and get a feel of how the plugin works.

I'll look again into the Package Control support and see if I can finally get it up and running.

Thanks a lot again, I hope it works for you!

zsszatmari commented 10 years ago

Hi!

I’d be glad to help, no problem. However, I don’t fully see how to install manually. In the ~/Library/Application\ Support/Sublime\ Text\ 3/Installed\ Packages directory I have some packages, effectively zip files but with .sublime-package extension. So it does not seem right to unpack all the files on git into the same dir. On the other hand, if I pack them manually, and give it .sublime-package extension, command palette does not seem to ‘see’ the commands, only ‘Browser Integration: Settings: Default’, and no other. Could you please give me some guidance on this?

Thanks! Zsolt

On 22 May 2014, at 20:48, Alejandro Piad notifications@github.com wrote:

Hi, Thanks for sharing!

It took me a while to answer, its been a while since I last updated this project, but I want to take a dive into it once more, to fix some remaining issues and adding new features. I never really got the plugin cleanly working when installed through Package Control. I think the issue is because plugins installed that way are kept (and run) inside a zipped file, and the code that searches for and opens some files breaks, as well as basically all code that depends on paths.

I know this is a lot to ask, but if you could you please try to download it directly from github, and unzip it into your Packages folder, instead of directly installing it from Package Control, just to see if the issue is with file paths or with chromedriver really? Of course, you should first uninstall it from within Package Control. You could also try to launch Firefox instead, since it doesn't require an external driver. Firefox support is very very initial and hence buggy, but it might allow you to at least see the available commands and get a feel of how the plugin works.

I'll look again into the Package Control support and see if I can finally get it up and running.

Thanks a lot again, I hope it works for you!

— Reply to this email directly or view it on GitHub.

apiad commented 10 years ago

Your right, in Installed Packages is where Package Control puts the packages it downloads. You should unzip it to the Packages folder instead, which should be along-side Installed Packages. Be sure to put it inside its own folder, it doesn't matter how you name it. On Linux I have the source for the plugin unzipped on ~/.config/sublime-text-3/Packages/BrowserIntegration/, maybe in MacOSX is somewhat similar.

Thanks to you... Alejandro Piad.

zsszatmari commented 10 years ago

Ah, it works this way! Thank You! I’d be happy to help more, if you have anything in mind that I can check, just tell me!

Wishes, Zsolt

On 22 May 2014, at 21:36, Alejandro Piad notifications@github.com wrote:

Your right, in Installed Packages is where Package Control puts the packages it downloads. You should unzip it to the Packages folder instead, which should be along-side Installed Packages. Be sure to put it inside its own folder, it doesn't matter how you name it. On Linux I have the source for the plugin unzipped on ~/.config/sublime-text-3/Packages/BrowserIntegration/, maybe in MacOSX is somewhat similar.

Thanks to you... Alejandro Piad.

— Reply to this email directly or view it on GitHub.

apiad commented 10 years ago

Great! I hope you like it. Don't hesitate to add new issues if you find something broken (there must be tons of bugs in there!). I'll try to get the Package Control support working this weekend and upload a new release next week. It would be great if you'd be willing to try and install it again using Package Control then. For the time being, feel free to use the plugin and make any comments on the current features, or new ones you would like. It would be very good to have feedback. It has had about 1K downloads so far, but except for this thread, I haven't had any feedback so far. So I thank you and also to @politicus for all the help you've provided!

Cheers, Alejandro Piad

zsszatmari commented 10 years ago

No, I thank You for making this package :) I’ll let you know if I need anything in particular!

Zsolt

On 22 May 2014, at 22:44, Alejandro Piad notifications@github.com wrote:

Great! I hope you like it. Don't hesitate to add new issues if you find something broken (there must be tons of bugs in there!). I'll try to get the Package Control support working this weekend and upload a new release next week. It would be great if you'd be willing to try and install it again using Package Control then. For the time being, feel free to use the plugin and make any comments on the current features, or new ones you would like. It would be very good to have feedback. It has had about 1K downloads so far, but except for this thread, I haven't had any feedback so far. So I thank you and also to @politicus for all the help you've provided!

Cheers, Alejandro Piad

— Reply to this email directly or view it on GitHub.

lefoy commented 9 years ago

I have the same issue with Chrome 36 on Mac 10.9.4. Here is the console log:

[Start] Browser Integration :: Opening new Chrome instance.
Exception in thread Thread-10:
Traceback (most recent call last):
  File "/Users/lefoy/Library/Application Support/Sublime Text 3/Packages/BrowserIntegration/selenium/webdriver/chrome/service.py", line 63, in start
    self.service_args, env=env, stdout=PIPE, stderr=PIPE)
  File "X/subprocess.py", line 818, in __init__
  File "X/subprocess.py", line 1416, in _execute_child
PermissionError: [Errno 13] Permission denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "X/threading.py", line 639, in _bootstrap_inner
  File "X/threading.py", line 596, in run
  File "/Users/lefoy/Library/Application Support/Sublime Text 3/Packages/BrowserIntegration/browser_integration_launch.py", line 28, in open_browser
    browser.connect(b)
  File "/Users/lefoy/Library/Application Support/Sublime Text 3/Packages/BrowserIntegration/browser.py", line 27, in connect
    '..', 'chromedriver'))
  File "/Users/lefoy/Library/Application Support/Sublime Text 3/Packages/BrowserIntegration/selenium/webdriver/chrome/webdriver.py", line 59, in __init__
    self.service.start()
  File "/Users/lefoy/Library/Application Support/Sublime Text 3/Packages/BrowserIntegration/selenium/webdriver/chrome/service.py", line 68, in start
    and read up at http://code.google.com/p/selenium/wiki/ChromeDriver")
selenium.common.exceptions.WebDriverException: Message: 'ChromeDriver executable needs to be available in the path.                 Please download from http://chromedriver.storage.googleapis.com/index.html                and read up at http://code.google.com/p/selenium/wiki/ChromeDriver' 

[End] Browser Integration :: Opening new Chrome instance.

I installed the plugin manually and the chromedriver binary is in /usr/local/bin and is executable. The plugin works well with Firefox but I use Chrome 99.9% of the time :\ I would really like to make this plugin work with Chrome.

Thanks :)

apiad commented 9 years ago

I'm currently working on getting rid of selenium, chromedriver and all dependencies.

The plugin attempts to download a version of chromedriver suitable for your OS, and place it next to where the plugin is installed, in the Packages folder. That is the chromedriver executable that selenium tries to open, not the one in /usr/bin/local/. This is to avoid issues with users own versions of chromedriver, which may be out of date, or too new, or whatever. You could try to go to your Installed Packages folder, and check if the chromedriver is there, and if its executable. If not, you can try to download it from http://sublime.apiad.net/browser-integration/chromedriver/ and place it right inside the Installed Packages folder, rename it to chromedriver and give it execution permissions.

It could turn out in the end that Chrome 36 is no longer compatible with this chromedriver version, and it doesn't work after all.

I know this is a lot, that is why I'm trying to remove all selenium dependencies, to get rid of the stupid chromedriver. I hope to get some updates online as soon as possible, maybe by the end of the week. It requires a complete restructuring of the plugin architecture. Thanks for the comprehension, and for trying the plugin!

Cheers, Alejandro Piad.

PS: You could try to launch Firefox instead of Chrome, is super experimental, but it might work...

EDIT: Sorry, I didn't see the last lines of your message until after answering. Definitely, it should be possible to make it work with Chrome, but since I work on Linux, all I can do is try to figure out what's going on remotely. Don't hesitate to ask if you keep having problems.

On Monday, August 11, 2014, lefoy notifications@github.com wrote:

I have the same issue with Chrome 36 on Mac 10.9.4. Here is the console log:

[Start] Browser Integration :: Opening new Chrome instance. Exception in thread Thread-10: Traceback (most recent call last): File "/Users/lefoy/Library/Application Support/Sublime Text 3/Packages/BrowserIntegration/selenium/webdriver/chrome/service.py", line 63, in start self.service_args, env=env, stdout=PIPE, stderr=PIPE) File "X/subprocess.py", line 818, in init File "X/subprocess.py", line 1416, in _execute_child PermissionError: [Errno 13] Permission denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "X/threading.py", line 639, in _bootstrap_inner File "X/threading.py", line 596, in run File "/Users/lefoy/Library/Application Support/Sublime Text 3/Packages/BrowserIntegration/browser_integration_launch.py", line 28, in open_browser browser.connect(b) File "/Users/lefoy/Library/Application Support/Sublime Text 3/Packages/BrowserIntegration/browser.py", line 27, in connect '..', 'chromedriver')) File "/Users/lefoy/Library/Application Support/Sublime Text 3/Packages/BrowserIntegration/selenium/webdriver/chrome/webdriver.py", line 59, in init self.service.start() File "/Users/lefoy/Library/Application Support/Sublime Text 3/Packages/BrowserIntegration/selenium/webdriver/chrome/service.py", line 68, in start and read up at http://code.google.com/p/selenium/wiki/ChromeDriver") selenium.common.exceptions.WebDriverException: Message: 'ChromeDriver executable needs to be available in the path. Please download from http://chromedriver.storage.googleapis.com/index.html and read up at http://code.google.com/p/selenium/wiki/ChromeDriver'

[End] Browser Integration :: Opening new Chrome instance.

I installed the plugin manually and the chromedriver binary is in /usr/local/bin and is executable. Thanks :)

— Reply to this email directly or view it on GitHub https://github.com/apiad/sublime-browser-integration/issues/2#issuecomment-51778330 .