Mailingliste - Einträge 2005


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [qftestJUI] string compare -- help I'm a dummy


  • Subject: Re: [qftestJUI] string compare -- help I'm a dummy
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: 06 Dec 2005 16:38:47 +0100

Hello Joe,

this stuff can be a bit tricky sometimes. The expression in the if
statement is passed to the Jython interpreter, so after expanding the
variables it must be a valid expression. In your case this means you
need to qoute as follows

"$(caseID)" == "$(tempCaseW)"

Note also the == instead of =.

This is fine most of the time but will fail in case the variable
values contain sppecial characters like quotes or a backslash. Windows
filenames are a common source of problems. A secure method that will
always work is

rc.lookup("caseID") == rc.lookup("tempCaseW")

Best regards,
    Greg

"Joe Greene" <joe.greene@?.com> writes:

>    Support,
>
>
>    See below stream produced in Run Log.
>
>    The expression is exactly what I want to test. It should return a
>    "true".
>
>    But I'm not getting it set up correctly.
>
>    This is set up in a IF statement with Condition field: $(caseID) =
>    $(tempCaseW)
>
>
>    I've tried putting single and double quotes in various combinations
>    around each variable in the condition field but can't seem to get by
>    this error.
>
>
>    Thanks for your time and efforts.
>
>    ++dummy
>
>
>
>    CLASS
>
>    de.qfs.apps.qftest.run.BadTestException
>
>
>    MESSAGE
>
>    The expression
>
>    '05-M123456789 = 05-M123456789'
>
>    is not a valid test.
>
>
>    STACKTRACE
>
>    de.qfs.apps.qftest.run.BadTestException: The expression
>
>    '05-M123456789 = 05-M123456789'
>
>    is not a valid test.
>
>
>    The Jython engine failed with the following message:
>
>    Traceback (innermost last):
>
>      File "<string>", line 1, in ?
>
>      File "C:\Program
>    Files\qfs\qftest\qftestJUI-1.08.4\jython\Lib\qftestJUI.py", line 137,
>    in evaltest
>
>      File "<string>", line 1
>
>                if 05-M123456789 = 05-M123456789: ret[0]='true'
>
>                                 ^
>
>    SyntaxError: invalid syntax
>
>
>                at
>    de.qfs.apps.qftest.run.AbstractRunContext.evalTest(AbstractRunContext.
>    java:1889)
>
>                at
>    de.qfs.apps.qftest.step.IfSequence.exec(IfSequence.java:417)
>
>                at
>    de.qfs.apps.qftest.run.AbstractRunContext.call(AbstractRunContext.java
>    :973)
>
>                at
>    de.qfs.apps.qftest.step.RepeatSequence.exec(RepeatSequence.java:398)
>
>                at
>    de.qfs.apps.qftest.run.AbstractRunContext.call(AbstractRunContext.java
>    :973)
>
>                at
>    de.qfs.apps.qftest.step.BasicSequence.exec(BasicSequence.java:672)
>
>                at
>    de.qfs.apps.qftest.run.AbstractRunContext.call(AbstractRunContext.java
>    :973)
>
>                at
>    de.qfs.apps.qftest.step.BasicSequence.exec(BasicSequence.java:672)
>
>                at
>    de.qfs.apps.qftest.run.AbstractRunContext.call(AbstractRunContext.java
>    :973)
>
>                at
>    de.qfs.apps.qftest.step.BasicSequence.exec(BasicSequence.java:672)
>
>                at
>    de.qfs.apps.qftest.step.Procedure.exec(Procedure.java:179)
>
>                at
>    de.qfs.apps.qftest.run.AbstractRunContext.call(AbstractRunContext.java
>    :973)
>
>                at
>    de.qfs.apps.qftest.run.AbstractRunContext.callProcedure(AbstractRunCon
>    text.java:1541)
>
>                at
>    de.qfs.apps.qftest.run.AbstractRunContext.callProcedure(AbstractRunCon
>    text.java:1442)
>
>                at
>    de.qfs.apps.qftest.step.ProcedureCall.exec(ProcedureCall.java:434)
>
>                at
>    de.qfs.apps.qftest.run.AbstractRunContext.call(AbstractRunContext.java
>    :973)
>
>                at
>    de.qfs.apps.qftest.step.BasicSequence.exec(BasicSequence.java:672)
>
>                at
>    de.qfs.apps.qftest.step.Procedure.exec(Procedure.java:179)
>
>                at
>    de.qfs.apps.qftest.run.AbstractRunContext.call(AbstractRunContext.java
>    :973)
>
>                at
>    de.qfs.apps.qftest.run.AbstractRunContext.callProcedure(AbstractRunCon
>    text.java:1541)
>
>                at
>    de.qfs.apps.qftest.run.AbstractRunContext.callProcedure(AbstractRunCon
>    text.java:1442)
>
>                at
>    de.qfs.apps.qftest.step.ProcedureCall.exec(ProcedureCall.java:434)
>
>                at
>    de.qfs.apps.qftest.run.AbstractRunContext.call(AbstractRunContext.java
>    :973)
>
>                at
>    de.qfs.apps.qftest.run.AbstractRunContext.run(AbstractRunContext.java:
>    707)
>
>                at
>    de.qfs.apps.qftest.run.AbstractRunContext$Runner.run(AbstractRunContex
>    t.java:5343)
>
>
>
>    [cid:image002.gif@?.FA6913E0] Joe Greene
>
>    Premier Data Services
>
>    Quality Assurance/Customer Support
>
>    [1]joe.greene@?.com
>
>    303-316-3732
>
>    800-210-9100

--
Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876


Videos Downloads Dokumentation Kaufen Gratis Testen