Hot answers tagged

11

Your application uses an API to interact with the database. It is possible to write your API in such a way that it presents correct results to the application and yet still uses the database in the wrong way. For example, imagine a database with an EMPLOYEE table and a MANAGER table. The tables are alike -- e.g. each contains a first name, last name, ...


7

Wouldn't any data inconsistencies expose themselves in the application itself? Maybe, maybe not. I've seen cases where applications lost some data after you've logged off. So while the UI looked fine, the database was actually incorrect after logoff. In addition, are you sure that every single element in the database is being displayed in the UI ...


7

For writing Selenium tests itself, none. Selenium does not use SQL. Now if the application under test uses SQL, maybe you need a bit of knowledge to setup test data for your tests. For basic SQL knowledge have a look at the free SQL course at Codecademy. This should probably be enough.


6

I don't want to repeat great answers other have provided, but I would like to share with one more lesson I learned about using database in tests. Combining feedback you have from both database assertions and UI assertions, often in one test, can be very useful for test case design, test execution performance and defect root cause isolation: If you spot an ...


5

In addition to user246's excellent example, some other cases where you'd want to validate the database storage in your scenario would include: You have a bulk update/insert function where it's impractical to validate the results via the front end, such as importing new user records from a CSV file. While you can go in through the front end and check that ...


4

CRUD stands for Create, Read, Update and Delete. (Retrieve may occasionally be substituted for Read.) Different users may have different CRUD cycles based upon the requirements of the system. A customer, for instance, might have the ability to create an account, retrieve it upon return to a website, update billing information, or delete it if necessary. An ...


4

I have always loved using Scooter Software - Beyond Compare (limited to 2 links) to visually compare between folder, files etc. Group of them or single. This should help with an easy to use Visual Compare. Daniel has created a great BC File Extension Forum Link | How To on GitHub. It uses simple export with command line to do compare SQLite DB. I ...


4

When someone asks me a question and I don't know the answer, I tell them I don't know the answer, and then I ask them to tell me what they think the answer is. Maybe you should do that next time. If you're an interview, I don't think you'll be judged worse for asking, since either way the interviewer already knows that you don't have the answer. And it's ...


3

This is a very common scenario. Sometimes there are ways to increase the speed of the requests by identifying problems with the route taken, but that requires traceroute and working with network admins and internet providers and is often a bit of a black hole. Often you can not fix the latency issues, so you need to fix your app to function as well as it ...


3

I'm a little out of date using sqllite but data types and stored procedures come to mind as feature gaps between sqllite and something like PostgreSQL. Beyond features, configuration settings (ex: threads in sqllite) could cause further irritation while trying to speed up your tests if used incorrectly. More generally though, you should understand that ...


2

In my experience, something like a csv compare can be done programmatically without too much of a speed hit - so long as there aren't many errors. The way I'd handle it is to have your baseline CSV files being the data you expect each table to contain, one for each table (excluding any timestamps or other time-sensitive data - you'd need to check that ...


2

I believe it is a very good idea read back from the database. The reason is that things sometimes (or often) are not quite as simple as they may look. In the example above: what happens if the phone number is all zeroes? What happen if a user actually has a phone number like this +46-728-123456 (a mobile number in Sweden, not mine, hope no-one gets a phone ...


2

[W]hat sort of direction should I head in for learning and practicing my SQL? W3Schools has good info on SQL. There are many flavors of SQL (MySQL and T-SQL are the big ones) but the basics are the same for the queries you'll likely use. What SQL concepts should I absolutely know before I head in? If you can SELECT and JOIN, you probably have enough to ...


2

Usually this exception occurs when the JDBC URL is wrong and not accepted by loaded drivers. You should have the jar files in the classpath. Also Try using JDBC driver specific URI prefix, which is jdbc:mysql:// for MySQL. I mean defining String dbaseURL = "jdbc:mysql://localhost:3306/selenium"; instead of String dbaseURL = "http://localhost:3306/...


2

To automate tests in Selenium you don't need to know SQL at all. However, knowledge of SQL helps in general in testing and test automation, for instance: finding useful test data automating test data setup checking intermediary results (e.g., whether a user has been locked in DB) of your tests


2

This is common problem, usually solved by object-relation mapper (ORM) helper library. There are many for Java (too many), so it is not easy to choose a good one. :-) Do your research before you commit to one of them.


2

It is obviously possible. I won't give you the code but I'll give you the direction: First you should rework public void jdbcdemo(). Add static modifier to the method. Also add the parameters definitions to the method. The parameter set is the same as your then step definition accepts. Rework jdbcdemo() method code. Where you create a statement, you should ...


2

Unless you have a clear demand on automated processing I would tend to storing results in Google Sheets. Here are few points for the choice: You can easily manage the data from wherever you are since it is world-wide accessible service (and has the client applications implemented for all the famous platforms) Sheets provide some data analytics tool-set You ...


2

As per Let's Start chapter of JMeter Getting Started Guide If you want to perform JDBC testing, then you will, of course, need the appropriate JDBC driver from your vendor. JMeter does not come with any JDBC drivers. So make sure to download Oracle JDBC Driver and drop it to JMeter Classpath. And don't forget to restart JMeter to pick the .jar up. ...


2

I was able to resolve this by embedding a CAST(expression as varchar(max)) in my sql query and then run the query via automation test in visual studio.


2

driver.findElement(By.name("pincode")).sendKeys(rs.getString(1)); Is this what you looking for


1

None. SeleniumHQ define Selenium simply as a tool which automates browsers. You can work with Selenium without any knowledge of SQL. However, you could combine Selenium and SQL to run more advanced and thorough tests - for example completing a web form with Selenium and then confirming the data's been saved in the database by running a SQL query. If ...


1

The most straightforward option seems to be using Microsoft Visual Studio. See How to: Create a Test Project for Database Unit Testing for details. If you looking for a free open source standalone tool an alternative solution can be Apache JMeter. It provides JDBC Request Sampler so you will be able to execute arbitrary TSQL queries and define pass/fail ...


1

Try using SchemaCrawler. SchemaCrawler is a free and open-source command-line tool that produces text (text, JSON, CSV, HTML) output that is designed to be diff-ed, using standard diff tools. It can compare both structure and data. Sualeh Fatehi, SchemaCrawler


1

I found an open source command line tool that can compare databases, csv, xml etc. http://www.diffkit.org/


1

Unless you are doing any database or backend testing, you dont need any SQL knowledge for selenium. Selenium is a UI automation tool. In case if your test data is separated by any Database, you may require SQL queries to retrieve data from the DB; that would be only plain language + DB connection.


1

The key part of your question is "to learn selenium" To learn selenium you don't need SQL knowledge inh order to be able to write good selenium test cases. However a broader answer includes the following scale: Junior Developer on a small system, tightly defined role using Selenium IDE with other frameworks available for querying data (e.g. RubyOnRails ...


1

For Data Driven testing / Validation I used SQL Queries. It depends on your test scenario, Few Examples You perform a UI operation. Results are listed. You can perform the same query from DB and check records count match When you add a new user / delete a user from front end. You can perform DB query and validate records updated / deleted For multipage ...


1

solution create a "summary" worksheet that connects all related worksheets this concept works for any data with a shared PK (primary key) all we're really doing is using standard VLookup functionality of Excel, but with an important twist instead of hard coding our VLookups we'll use Excel's INDIRECT function to execute our VLookups based on ...


1

issue solution - exact same results, but much faster execution


Only top voted, non community-wiki answers of a minimum length are eligible