tags:

views:

235

answers:

3

Does anyone know how to connect DB from Selenium RC? I need to run a lot of user IDs and passwords with different role access. Currently I am using this as data suite with an HTML file.

+1  A: 

Well, I know that Selenium tests can be outputted and run as as JUnit tests. From JUnit you can easily write test infrastructure that connects to your DB and does whatever else you need it to do.

Edit: You're of course not limited to JUnit and Java. You can run Selenium via Ruby, .Net, Python or pretty much whatever you'd like.

mikek
+1  A: 

You cannot connect to the database with Selenium RC. Selenium RC is just a small program that listens on a port and does things to the browser. It does not know about where the data you are testing comes from.

As Mike said above, you can export or write your tests either in your favorite programming language or some testing framework. This allows you to create a DB connection, preload your database with data (like your users/roles) and do your tests in a more dynamic and maintainable fashion.

c_maker
A: 

Can we get some sample code were quering of sqlite3 DB in JUNIT fW can be known ???

shashidhar