qmetry / qaf

Quality Automation Framework for web, mobileweb, mobile native and rest web-service using Selenium, webdrier, TestNG and Java Jersey
https://qmetry.github.io/qaf
MIT License
253 stars 137 forks source link

DBUtil converts the query to lowercase #225

Open BChitrakannan opened 6 years ago

BChitrakannan commented 6 years ago

Hi Team,

I am facing an issue. I have an encrypted value and i need to use it in my query. But it is being converted to lower case.

Ex: my key:oxNmgzVqBb+PgyFJE/VvaTBP1OY//f1I7wbmcmsH80Q=

in query: select * from table where key='oxnmgzvqbb+pgyfje/vvatbp1oy//f1i7wbmcmsh80q='

So I am not getting the output. Is there any way we can fix this or is this a bug?

Thanks for your reply.

I am using jdbc6.

Kindest Regards, CK

Rajdi commented 6 years ago

image Actual sql was SELECT * FROM some_table_name WHERE column_name ='xyz' Observation : The method getDataFromDB is ignoring the query after '=' equal to relational operator. And it fails to execute the SQL.

Rajdi commented 6 years ago

Adding additional information to my above comment.Using ojdbc7 and qaf-2.1.13.jar fails to execute SQL with an equal to in where clause java.sql.SQLSyntaxErrorException: ORA-00920: invalid relational operator

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399) at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1059) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:587) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:30) at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:762) at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:925) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1111) at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1309) at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:422) at com.qmetry.qaf.automation.util.DatabaseUtil.getRecordDataAsMap(DatabaseUtil.java:207) at com.qmetry.qaf.automation.testng.pro.DataProviderUtil.getDataFromDB(DataProviderUtil.java:110) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:55) at org.testng.internal.MethodInvocationHelper.invokeMethodNoCheckedException(MethodInvocationHelper.java:45) at org.testng.internal.MethodInvocationHelper.invokeDataProvider(MethodInvocationHelper.java:111) at org.testng.internal.Parameters.handleParameters(Parameters.java:509) at org.testng.internal.Invoker.handleParameters(Invoker.java:1293) at org.testng.internal.Invoker.createParameters(Invoker.java:1020) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1110) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112) at org.testng.TestRunner.privateRun(TestRunner.java:781) at org.testng.TestRunner.run(TestRunner.java:635) at org.testng.SuiteRunner.runTest(SuiteRunner.java:387) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340) at org.testng.SuiteRunner.run(SuiteRunner.java:289) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293) at org.testng.TestNG.runSuitesLocally(TestNG.java:1218) at org.testng.TestNG.runSuites(TestNG.java:1133) at org.testng.TestNG.run(TestNG.java:1104) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77) Warning: the data provider 'isfw_database' returned an empty array or iterator, so this test is not doing anything

It would be a great help, if you could let me know of any solution to address this issue. Thank you!

cjayswal commented 6 years ago

@BChitrakannan will you please provide steps to reproduce your issue?

cjayswal commented 5 years ago

@BChitrakannan will you please try with 2.1.14-RC3?

BChitrakannan commented 5 years ago

Hi @cjayswal is it available as a jar file yet? I dont seem to find it. Or Should i download the source code and test?

Best regards, CK

cjayswal commented 5 years ago

check https://mvnrepository.com/artifact/com.qmetry/qaf

BChitrakannan commented 5 years ago

Hi @cjayswal ,

Thanks! I just checked it. Capital letters are retained in the query but not in the value which we pass in the where clause.

Actual Query:

select * from HELLo.table where id='XuioWND9899nsmdfWFKJK'

Query sent to the DB: select * from HELLo.table where id='xuiownd9899nsmdfwfkjk'

cjayswal commented 5 years ago

@BChitrakannan i tried to reproduce above behavior with latest version (2.1.14) but not able to reproduce. Will you please provide more details or sample test to reproduce the behavior?

BChitrakannan commented 5 years ago

@cjayswal Thanks for getting back.

Unfortunately I dont have a sample test.

Can you please run a query like this ?

select * from TABLE where id = "AAqweK";

here AA and K will be converted to lower case automatically.