1

This question already has an answer here:

I am new in selenium.i am trying for the database testing in selenium webdriver using eclipse.

i have install mysql 6.3 server and configure ojdbc14.jar and mysql-connector-java-5.1.25.jar in eclipse please help me for how to perform databse testing?

marked as duplicate by Michael Durrant, Niels van Reijmersdal, dzieciou, Kate Paulk, Yu Zhang Jan 5 '17 at 16:24

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Are you positive you want to test a database using Selenium? Or do you want to connect to the database from you Selenium tests for some other reason? – Radek Jan 5 '17 at 12:20
  • See also sqa.stackexchange.com/q/9074/8992 – Michael Durrant Jan 5 '17 at 12:27
  • @Radek i want to connect database in eclipse and want to perform the testing on it – Rutvi Soni Jan 5 '17 at 12:32
3

Selenium is used for automating user-browser interaction with the HTML and Javascript on websites.
It does not have any functionality to test databases other than indirectly through web applications and HTML pages.

Per http://www.seleniumhq.org/ "Selenium automates browsers. That's it! What you do with that power is entirely up to you. Primarily, it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) also be automated as well."

One option to test database information is to use a programming framework for Selenium that allows access to application database information, usually through an implementation of ORM (Object-relational mapping). One example is ruby-on-rails with RSpec which could allow you to both check the web page view using the Capybara DSL and also check database information via Active Record. Be aware however that there are asynchronus and timing issues here. Recently we stopped doing the database check due to these issues which were causing the dreaded intermittent test failures.

[Update - baed on your links the old selenium 1.0 'RC' version had a way but this is now being phased out and is un-supported.

1

If you really want to test the database, and assuming you're using MySQL, then the most convenient way to do it is to use their testing framework: https://dev.mysql.com/doc/mysqltest/2.0/en/.

Skip Selenium, Eclipse, etc., they're not the tools for this job, as Michael already pointed out.

  • ok.let me check – Rutvi Soni Jan 5 '17 at 12:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.