I'm about to return to Selenium after a break with a view to moving into the Selenium testing arena full time (hopefully) after 11 years of mainly QTP. A couple of years ago I taught myself enough Python to create quiet a few test data creation scripts using the standalone Python webdriver egg.
When I look at the current job specs for Selenium a high %age are asking for Selenium/Java experience but very few for Selenium/Python . Do you think it better (long term) to go forward with Selenium/Java or build on the Selenium/Python experience I already have?
You should use what ever languages you developer are using. I've always found it's much easier to learn a new programming language, than it is to deal with issues dealing with having teams work on separate platforms. Using the same programming language as your developers have the following benefits:
Originally Posted by mwsrosso
1) Easier to integrate into CI since you'll be inline with all the tools your developers are using.
-- One of the hardest things to do when setting up CI is manage all the dependencies and getting the code to deploy right. By unifying the platforms and compilation tools, etc.. You probably heard the holy grail is implementing "Continuous Deployment". This is very annoying to do as you involve more platforms and services, so it's good to simplify.
2) Easier test setup.
-- There will be time you need to hook into lower level calls. For example, force calling a background service to trigger a task that's normally scheduled (like monthly billing). Using the same languages and APIs allow you to share code with your developers. For example, there are tons of integration tests the developers are calling which do smaller lower level things. Since I use the same language and build process as the main product itself, I can directly consume extra test and harness code that the developers have already created.
3) Getting developer support.
-- There will be times you need to create test hooks or integrations. If you use the same language, they can easily work in your test project.
4) It makes it easier to have your devs run the tests before check in.
-- One of the things that will drive you insane is developer checking in new features that will break your tests. If you can't get your devs to run your tests prior to check in, then your entire process is broken. You'll find yourself spending 70% of your time just fixing tests that are broken simply because a developer didn't give you a heads up on what got changed. In the world where developers are programming in the same language, they'll see which tests got broken, and simple things like the IDs have changed, then can easily fix prior to check in.
*** If you are treating the dev as a black box.. ***
My opinion is Python is easiest to pick up. The language syntax and fairly simple, and I feel there is less boilerplate declarations. For more advanced programmers, since Python allows for multiple inheritance, it fits very well with componentizing your PageObjects. For example, say you have a home page, it consists of a navigation bar, a dashboard, and quick actions panel, all of these components being used in different combinations in other pages. The Python "Mixin" model fits this very well. In more traditional compiled languages, you tend to need declare and use extra interfaces.
If you intend on contributing back to Selenium and Selenium grid projects, or need to make modification to the core Selenium code, then Java would be best to learn. The base project is built in Java, and if you need to do custom such as adding custom hi def video recordings into your tests. I think a lot of large mega corporate enviornments need to have more productivity tools that the simple selenium grid doesn't have out of the box. A good example of this is, https://github.com/groupon/Selenium-Grid-Extras, because Selenium Grid is a pain in a** to maintain, so they created custom tools around it. That's probably one of the reason most enterprise Selenium shops are using java.
Another way to use Selenium that I don't hear much about is Visual Studio with C#. I'm not asking anything here. I just wanted to mention it as anohter posibility.
Another great post David!
Ideally that would be the way forward, however I'm a freelancer so client specifics are unknown quantities. I'm leaning towards Java based purely on the current market in the UK. I do use Python for other stuff (large log processing etc.) so I will still be 'keeping my hand in'