mtrubs / intellibot

IntelliJ/PyCharm plugin for Robot Automation Framework
https://github.com/millennialmedia/intellibot/wiki
MIT License
158 stars 109 forks source link

Some Selenium2Library keywords not resolving to source in Pycharm #38

Closed skipkent closed 10 years ago

skipkent commented 10 years ago

Firstly, I love this plugin. Well done! Jumping to source in a large project is a real sweat-saver. ;)

I've run into a difficulty with jump-to-source (in PyCharm) in which some of the basic Selenium2Library keywords do not resolve successfully to source. 'Click Element' for example, should resolve to the source in the _element.py file. There is a .pyc file generated for this file and others on my Mac in /Library/Python/2.7/site-packages/Selenium2Library/keywords folder but I get a 'Cannot find declaration to go to' message in PyCharm when I try to jump to source. Some of the Selenium2Library keywords, such as 'Open Browser' resolve just fine, so it seems strange that some work and some don't. Permissions are identical across all files. Thanks in advance for any help you can offer on this.

skipkent commented 10 years ago

I wonder if the fact that the Selenium2Library filenames are all prefaced with an underscore _ has something to do with it. ?

mtrubs commented 10 years ago

First off, thanks for your gratitude.

I use this plugin quite a bit for work, though we tend to use IntelliJ here. I can check out pycharm. I do tend to find that in these cases the issue is not with the plugin but with how you have the IDE setup. An easy-ish check is to create a python file and confirm that it recognizes the 'click element' keyword and such. If it can than the robot plugin should be able to as well. If it can and the robot plugin cannot then there is likely something going on with my code. I can try and test this myself but I might be able to get to it as fast as you can. Thanks.

skipkent commented 10 years ago

Thanks for the quick response! I'm actually looking at some legacy code that I've just inherited and can't quite run yet on my home laptop until I get quite a bit more environment setup done. I'm ashamed to say I haven't yet tried the test you mention and will get to that shortly. :) Thanks!

skipkent commented 10 years ago

My apologies. I just did the check you mentioned with a simpler, earlier project I had done when learning Robot and it (Selenium2Library keywords) resolves just fine. There's clearly some aspect of the codebase I'm looking at (which is quite old) that is gumming up the works in that regard. If and when I figure out what the problem is, I'll post an update here to let you know in case it's of any use.

skipkent commented 10 years ago

It turns out that some of the files I'm looking at didn't have Selenium2Library included in the * Settings * section at the top. Apparently the library is being inherited from elsewhere, which makes this a RobotFramework question and nothing to do with your plugin. Thanks again for your help!

mtrubs commented 10 years ago

well that is good to hear. I did make the decision not to run down imports of imports of imports. I wanted it to act like java (even if the robot framework itself doesn't).