You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2009/09/17 12:16:56 UTC
DO NOT REPLY [Bug 47857] New: if statement used in Beanshell Scripts
https://issues.apache.org/bugzilla/show_bug.cgi?id=47857
Summary: if statement used in Beanshell Scripts
Product: JMeter
Version: 2.3.4
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: HTTP
AssignedTo: jmeter-dev@jakarta.apache.org
ReportedBy: sumittandon16@gmail.com
The if statement always evaluates to false, irrespective of the value in the
condition under test. This has been tried for Beanshell scripts in
pre-processor, post-processor & assertions. The scripting was done in beanshell
with the correct syntax in mentioned elements, but the result was the same.
Although the same conditions were executed using the switch-case control
statements, and it worked.
Explaination with example.
if(Val=="1"), if(Val=='1'), if(Val==`1`), if(Val="1"), if(Val='1') &
if(Val=`1`).
All of them were tried, but to no avail. But when for the same, the print
statement was executed, the Value of "Val" was displayed as "1". This has been
tested for all the possible values, numeric as well as characters, but none
work.
The desired procedure was achieved using Switch value of "Val" and Case value
of "1", using the switch case control statements.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 47857] if statement used in Beanshell Scripts
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47857
--- Comment #5 from Suumit <su...@gmail.com> 2009-10-28 00:03:56 UTC ---
Created an attachment (id=24431)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=24431)
JMeter Script using switch-case in Beanshell Pre-Processor
This is a simple JMeter Script which has search request to Google. The thread
group uses Switch Case statements in Beanshell Pre-Processor before sending the
request. The command prompt window shows the results of operations in Beanshell
Pre-processor.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 47857] if statement used in Beanshell Scripts
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47857
--- Comment #4 from Suumit <su...@gmail.com> 2009-10-28 00:02:17 UTC ---
Created an attachment (id=24430)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=24430)
JMeter Script using If statement in Beanshell Pre-Processor
This is a simple JMeter Script which has search request to Google. The thread
group uses If statement in Beanshell Pre-Processor before sending the request.
The command prompt window shows the results of operations in Beanshell
Pre-processor.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 47857] if statement used in Beanshell Scripts
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47857
Sebb <se...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
--- Comment #7 from Sebb <se...@apache.org> 2009-10-28 03:58:01 UTC ---
The code in the If test case is invalid:
if(value==1) print("Google It!");
else print("Forget It!");
if(data=="India") print("Google It!");
else print("Forget It!");
value and data are string variables, and need to be compared using the equals()
method.
e.g.
if (value.equals("1")) etc.
In future, please ask such usage questions on the user list.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 47857] if statement used in Beanshell Scripts
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47857
Sebb <se...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
--- Comment #1 from Sebb <se...@apache.org> 2009-09-17 03:39:30 PDT ---
The If statement does work; if you want help please post a message to the
JMeter user list. Bugzilla is not a help forum.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 47857] if statement used in Beanshell Scripts
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47857
Suumit <su...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|INVALID |
--- Comment #2 from Suumit <su...@gmail.com> 2009-10-26 23:15:56 UTC ---
Hi Sebb,
It is a bug. I'm not seeking help. I have used switch case instead to move
ahead with my task. Pleas recheck. I have tried this with all poosible
scenarios. I'm an ardent JMeter user, so i have reported it. Please take a
serious look at it.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 47857] if statement used in Beanshell Scripts
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47857
Sebb <se...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |NEEDINFO
--- Comment #3 from Sebb <se...@apache.org> 2009-10-27 03:30:33 UTC ---
There is nothing to look at.
Please provide a _simple_ test case which shows the problem (attach the JMX
file to this issue).
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 47857] if statement used in Beanshell Scripts
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47857
Suumit <su...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|sumittandon16@gmail.com |
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 47857] if statement used in Beanshell Scripts
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47857
Suumit <su...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |NEW
--- Comment #6 from Suumit <su...@gmail.com> 2009-10-28 00:06:52 UTC ---
Hi Sebb,
I have attached simple .jmx files using both control statements 'If-else' and
'Switch-Case'. The 'If' else statement clearly doesn't work.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 47857] if statement used in Beanshell Scripts
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47857
Suumit <su...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sumittandon16@gmail.com
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org