Showing posts from July, 2011

SoapUI Excel DataSource Definition & DataSourceLoop Usage

Comprehensive test suites require varying test datasets to cover many cases each of which can be the reason of a bug, in advance. In order to eliminate the possibility of unexpected behaviours of target application, using prepared large portion of test datasets in test cases are essential in software testing. However, preparing a test case for each of different test data might be troublesome to developer. Thus, parametrizing the inputs and using datasets iteratively to fulfill the inputs is the answer to problem. In soapUI, datasources can be added to test cases to retrieve test datasets from databases (Oracle, MySQL, Derby, SqlServer, etc.), excel files (*.xls) or files (*.xml, *.txt). Below, in SoapUI test suites, I shortly intended to present: how to use excel files as a datasource  how to iterate on datasets of datasource with DataSourceLoops how to parametrize your test datas to your test cases' inputs In your soapUI project, add a datasource to your test steps then defi

Oracle & MySQL - Selecting Requested Number of Records from Database

Listing records from database causes critical performance bottlenecks when there are huge amount of data exists. For example, in an online shopping page, retrieving 1.000.000 products from database to application server surely takes too much time or even crash of the server with clients load. Instead of retrieving all products once, requesting only a part of product list is favorable. Below, SQL examples are selecting five rows between 5th and 10th rows from table on both Oracle and MySQL. MYSQL SYNTAX SELECT S.ROW_NUM, S.COLUMN1 FROM (SELECT (@ROWNUM:=@ROWNUM+1) AS ROW_NUM, COLUMN1 FROM DEMO_TABLE D, (SELECT @ROWNUM:=0) R ) S WHERE S.ROW_NUM <= 10 AND S.ROW_NUM > 5 ORACLE SYNTAX SELECT A.ROW_NUM, A.COLUMN1 FROM (SELECT ROWNUM AS ROW_NUM, COLUMN1 FROM DEMO_TABLE ORDER BY COLUMN1) A WHERE A.ROW_NUM <= 10 AND A.ROW_NUM > 5