RE: Feeding a JDBC sampler with multiple SQL statements from a SQL script file
Thanks for your help - I now have some improvements . I did the following: I tried ${SQLStmt} in the JDBC sampler - but that did not work because always a ? was placed in front of my SQL string. Therefore, I added a dummy-column in my SQL script file. The file looks now: dummy;SELECT * FROM dbc.tablesV ORDER BY 1 dummy;SELECT * FROM dbc.tablesV ORDER BY 1, 2, 3 My CSV data set config has now the following settings: - filename: C:\JMeterCSVSQL.txt - character set: UTF-8 - variable name: dummy,SQLStmt - delimiter: ; I do not use the dummy variable, but now I can execute one SQL statement which is placed in the SQL script file. However, there is one problem again: Only the first SQL statement of the textfile gets executed - the others do not get executed. I am not sure, why JMeter does not fetch row after row of the textfile and does not execute all statement. The debugging info also did not show me any more information about that. Do you have any other hints to solve this issue? thanks Subject: Re: Feeding a JDBC sampler with multiple SQL statements from a SQL script file From: oliver_ll...@hotmail.com Date: Sat, 7 Apr 2012 10:24:12 +0100 To: user@jmeter.apache.org One thing, have you tried with ${SQLStmt} - ${} is the notation for how JM refers to variables. Apart from that, as it stands this should work. Try moving the View Results Tree Listener from where it is as a child of the JDBC request to the top of the testplan, that way you will see results for everything. Then add a Debug Request, that will show more information. On 7 Apr 2012, at 09:59, Wolfgang Wyremba wrote: hello, let my outline my current configuration below... So, is there a way to feed a JDBC sampler with an external file, holding different SQL statements? Yes, you can pass a variable directly into the SQL statement itself. Eg. In the Query edit box, you might have something like: INSERT INTO `myDB`.`emails` (`email`) VALUES ('${myEmail}'); Where ${myEmail} is a jmeter variable. I could find one posting in this mailling list, discussing this issue using CSV data set configs: http://jmeter.512774.n5.nabble.com/How-to-run-SQL-log-against-database-td525660.html However, I am not sure, whether this is the right solution and additionally I could not manage to get it working. Sounds like a good solution to me, there may be others, but this would certainly work and actually, probably isn't all that hard. You just ahve to get the CSV Dataset Config to work. What exactly is it that is causing you trouble? I have a working JDBC configuration and I can run a single SQL statement without any problems in a JDBC sampler. I set up a text-file called JMeterCSVSQL.txt which has two SQL statements - each in a line seperated with a semicolon: SELECT * FROM DBC.TablesV ORDER BY 1; SELECT * FROM DBC.TablesV ORDER BY 1, 2, 3; My CSV data set config has the following settings: - filename: C:\JMeterCSVSQL.txt - character set: UTF-8 - variable name: SQLStmt - delimiter: ; I did not touch the other settings. My JDBC sampler has the following settings: - Variable Name Bound To Pool: DB1 ... this is my working DB-connection - Query-Type: SELECT statement - Query: {SQLStmt} I did not touch the other settings. Well, this configuration does not work. I always get the following JDBC Error: sample t=33 lt=33 ts=1333788631220 s=false lb=JDBC Request rc=HY000 1074 rm=com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC 13.10.00.29] [Error 1074] [SQLState HY000] Invalid Escape Clause quot;{SQLStmt}quot; tn=TG_Queries 1-1 dt=text by=0/ I also tried to change the query to '{SQLStmt}' but that didn't work as well. The JDBC error then is: sample t=35 lt=33 ts=1333788770333 s=false lb=JDBC Request rc=42000 3706 rm=com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 13.10.00.29] [Error 3706] [SQLState 42000] Syntax error: expected something between the beginning of the request and the string apos;{apos;. tn=TG_Queries 1-1 dt=text by=0/ My layout of my JMeter file is: Thread Group JDBC Connection CSV Data Set Config JDBC Request View Result Set in Table Summary Report So, there seem to be some small changes needed; but I am not sure what I have to change to get it working. I hope you can give me some more hints on how to solve this issue. Thanks. - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org
how to work with url encoded strings?
hi all, i am a new bee to jmeter.in my application there is value for from a response which i captured using regular expressions.its working find.but in one of the samplers its been passed with url conversion in the string.. can some one help me how to handle this situation... value that i have captured : ab457-ghk346-fcf-jye-hgh54 value that i need to send : ab457%2eghk346%2efcf%2ejye%2ehgh54 please let me know the solution in detail.. Thanks in anticipation -- View this message in context: http://jmeter.512774.n5.nabble.com/how-to-work-with-url-encoded-strings-tp5629335p5629335.html Sent from the JMeter - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org
Re: how to work with url encoded strings?
Hi, if you are sending that value in a HTTP request Ensure 'Encode?' is ticked ZK -- View this message in context: http://jmeter.512774.n5.nabble.com/how-to-work-with-url-encoded-strings-tp5629335p5629380.html Sent from the JMeter - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org
Re: how to work with url encoded strings?
Thanks for your qucik reply. but it is not working.i captured the value and stored it in {UID}.even if i checked the encode,it is sending the value as i captured previously. ${UID} : ab457-ghk346-fcf-jye-hgh54 SEND PARAMETERS WITH REQUEST userInfoId ${UID} truetrue but no luckstill sending value--- ab457-ghk346-fcf-jye-hgh54 ,but i need to send ab457%2Dghk346%2Dfcf%2Djye%2Dhgh54 plaese let me know how to work in other ways to resolve.:( -- View this message in context: http://jmeter.512774.n5.nabble.com/how-to-work-with-url-encoded-strings-tp5629335p5629428.html Sent from the JMeter - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org
Re: Feeding a JDBC sampler with multiple SQL statements from a SQL script file
On 10 April 2012 09:28, Wolfgang Wyremba w...@live.de wrote: Thanks for your help - I now have some improvements . I did the following: I tried ${SQLStmt} in the JDBC sampler - but that did not work because always a ? was placed in front of my SQL string. That must have come from the CSV file - did you create it with a text editor, or a word-processor? Therefore, I added a dummy-column in my SQL script file. The file looks now: dummy;SELECT * FROM dbc.tablesV ORDER BY 1 dummy;SELECT * FROM dbc.tablesV ORDER BY 1, 2, 3 My CSV data set config has now the following settings: - filename: C:\JMeterCSVSQL.txt - character set: UTF-8 - variable name: dummy,SQLStmt - delimiter: ; Which is fine so long as you never need to include a semi-colon in your SQL statement. I do not use the dummy variable, but now I can execute one SQL statement which is placed in the SQL script file. However, there is one problem again: Only the first SQL statement of the textfile gets executed - the others do not get executed. I am not sure, why JMeter does not fetch row after row of the textfile and does not execute all statement. The debugging info also did not show me any more information about that. Do you have any other hints to solve this issue? thanks Subject: Re: Feeding a JDBC sampler with multiple SQL statements from a SQL script file From: oliver_ll...@hotmail.com Date: Sat, 7 Apr 2012 10:24:12 +0100 To: user@jmeter.apache.org One thing, have you tried with ${SQLStmt} - ${} is the notation for how JM refers to variables. Apart from that, as it stands this should work. Try moving the View Results Tree Listener from where it is as a child of the JDBC request to the top of the testplan, that way you will see results for everything. Then add a Debug Request, that will show more information. On 7 Apr 2012, at 09:59, Wolfgang Wyremba wrote: hello, let my outline my current configuration below... So, is there a way to feed a JDBC sampler with an external file, holding different SQL statements? Yes, you can pass a variable directly into the SQL statement itself. Eg. In the Query edit box, you might have something like: INSERT INTO `myDB`.`emails` (`email`) VALUES ('${myEmail}'); Where ${myEmail} is a jmeter variable. I could find one posting in this mailling list, discussing this issue using CSV data set configs: http://jmeter.512774.n5.nabble.com/How-to-run-SQL-log-against-database-td525660.html However, I am not sure, whether this is the right solution and additionally I could not manage to get it working. Sounds like a good solution to me, there may be others, but this would certainly work and actually, probably isn't all that hard. You just ahve to get the CSV Dataset Config to work. What exactly is it that is causing you trouble? I have a working JDBC configuration and I can run a single SQL statement without any problems in a JDBC sampler. I set up a text-file called JMeterCSVSQL.txt which has two SQL statements - each in a line seperated with a semicolon: SELECT * FROM DBC.TablesV ORDER BY 1; SELECT * FROM DBC.TablesV ORDER BY 1, 2, 3; My CSV data set config has the following settings: - filename: C:\JMeterCSVSQL.txt - character set: UTF-8 - variable name: SQLStmt - delimiter: ; I did not touch the other settings. My JDBC sampler has the following settings: - Variable Name Bound To Pool: DB1 ... this is my working DB-connection - Query-Type: SELECT statement - Query: {SQLStmt} I did not touch the other settings. Well, this configuration does not work. I always get the following JDBC Error: sample t=33 lt=33 ts=1333788631220 s=false lb=JDBC Request rc=HY000 1074 rm=com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC 13.10.00.29] [Error 1074] [SQLState HY000] Invalid Escape Clause quot;{SQLStmt}quot; tn=TG_Queries 1-1 dt=text by=0/ I also tried to change the query to '{SQLStmt}' but that didn't work as well. The JDBC error then is: sample t=35 lt=33 ts=1333788770333 s=false lb=JDBC Request rc=42000 3706 rm=com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 13.10.00.29] [Error 3706] [SQLState 42000] Syntax error: expected something between the beginning of the request and the string apos;{apos;. tn=TG_Queries 1-1 dt=text by=0/ My layout of my JMeter file is: Thread Group JDBC Connection CSV Data Set Config JDBC Request View Result Set in Table Summary Report So, there seem to be some small changes needed; but I am not sure what I have to change to get it working. I hope you can give me some more hints on how to solve this issue. Thanks. - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail:
Re: how to work with url encoded strings?
Hi, then you can achieve this using a 'BeanShell PreProcessor' Just do a replace on your extracted string (replace '-' with '%2D') ZK -- View this message in context: http://jmeter.512774.n5.nabble.com/how-to-work-with-url-encoded-strings-tp5629335p5629635.html Sent from the JMeter - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org
Feature request...
I use the 'GUI' mode for most of my JMeter testing. I configure a 'Tree Listener' to show any errors, to help me debug - I check the Log/Display Only: Errors box, so that it only shows errors encountered. Is it possible to have the tree listener log the entire thread loop when it encounters an error? That is, let's say I have a thread that ends up running through 10 samplers. Currently, when I encounter an error in sampler # 8, only that response is logged in the Tree Listener. I would love to see samplers 1-8 logged when the error occurs in the 8th sampler of the loop - so that I can trace the entire context of the failure through the test plan. As it stands right now, if sampler #1 is 'login', and sampler #2 is show pageX, and sampler #3 is POST formY, ...; by the time I get to sampler #8, the die may have already been cast - and I might not know why sampler #8 broke... But if I could see the entire thread for that loop, I would be able to trace the steps back correctly. Basically, I want to retain the entire set of results for a thread until the thread starts over at the beginning of the loop - then if the loop completes without exception, discard the result set and start over again. If the loop throws an exception, log the retained results in the Tree Listener. Also, while I'm at it. It would be nice if the Tree Listener could group results by thread. That is, create a folder for each thread, so that the results of thread #1 can be reviewed independently from the results of thread #99 (this would be especially useful when logging successful responses _and_ errors since it would keep the request/responses for a given thread in a group with the same thread). As it stands right now - all threads record in groups for the sampler name for each instance of the request, so I see all the results essentially grouped by sampled response by 'time' (I put 'time' in scare quotes because it's not exactly by 'time', it depends on when the sampler gets the chance to write its results - which may or may not be sequenced by time as compared to a different thread - I frequently see the results show up out of order based on their timestamps - but it is relatively close to time ordered). I think this feature would be necessary in order for the above feature request to be useful - otherwise it would take a lot of effort to identify which sampler shown in the response tree matched to each error. -- Robin D. Wilson Sr. Director of Web Development KingsIsle Entertainment, Inc. VOICE: 512-777-1861 www.KingsIsle.com - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org