Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium Webdriver with Java vs. Python

I'm wondering what the pros and cons are of using Selenium Webdriver with the python bindings versus Java. So far, it seems like going the java route has much better documentation. Other than that, it seems down to which language you prefer, but perhaps I'm missing something.

Thanks for any input!

like image 917
Leslie Chong Avatar asked Dec 19 '12 20:12

Leslie Chong


People also ask

Is Selenium same for Java and Python?

As already mentioned, selenium is compatible with numerous languages namely; Perl, Ruby, C#, Java, Python and so on.

Which is better Python or Selenium?

"Great libraries", "Readable code" and "Beautiful code" are the key factors why developers consider Python; whereas "Automates browsers", "Testing" and "Essential tool for running test automation" are the primary reasons why Selenium is favored.

Which language is better for Selenium?

For individuals who haven't programmed before, using script-friendly languages like Python, Ruby, and others could be the best way to go. They have an easy learning curve, and also allow Selenium tests to be written quickly and with less code.

Is it good Learn Selenium with Python?

It requires far less code than other programming languages. It has an English-like syntax that makes it human-readable. Also, it is easy to pick up and learn due to its less complex syntax. Python is a free, open-source programming language with numerous libraries and frameworks.


2 Answers

"If you're running selenium tests against a Java application, then it makes sense to drive your tests with Java." This is untrue. It makes no difference what the web application is written in.

Personally I prefer python because it's equally as powerful as other languages, such as Java, and far less verbose making code maintenance less of a headache. However, if you choose a language, don't write it like you were programming in another language. For example if you're writing in Python, don't write like you were using Java.

like image 53
user5847248 Avatar answered Oct 04 '22 22:10

user5847248


Generally speaking, the Java selenium web driver is better documented. When I'm searching for help with a particular issue, I'm much more likely to find a Java discussion of my problem than a Python discussion.

Another thing to consider is, what language does the rest of your code base use? If you're running selenium tests against a Java application, then it makes sense to drive your tests with Java.

like image 44
Aurand Avatar answered Oct 04 '22 22:10

Aurand