List Icon
Archiv Mailingliste

2019 bis Juli 2022  2018  | 2017 2016 2015 | 2014 | 2013

Die Mailingliste ist seit Juli 2022 geschlossen, dient aber weiterhin als Informationsarchiv zu QF-Test.
Wenn Sie über Neuerungen zu QF-Test informiert bleiben wollen, können Sie einfach unseren Newsletter abonnieren:
Newsletter abonnieren


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

[QF-Test] How to compare the component displayed value


  • Subject: [QF-Test] How to compare the component displayed value
  • From: "Liu, Kevin (DPTI)" <Kevin.Liu@?.au>
  • Date: Mon, 7 Aug 2017 08:53:08 +0000
  • Delivered-to: qftest-list@?.net

Hi,

 

I am writing an if condition in my sequence as follows:

 

rc.getComponent("label0.00").getAttribute('value’) != "0.00"

 

and I am getting the following error:

de.qfs.apps.qftest.shared.exceptions.BadTestException: The _expression_

'rc.getComponent("label0.00").getAttribute(’value’) != "0.00"'

is not a valid test.

 

The Jython engine failed with the following message:

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "C:\Program Files (x86)\qfs\qftest\qftest-4.1.4\jython\Lib\qftest.py", line 172, in evaltest

    exec "if " + test + ": ret[0]='true'" \

  File "C:\Program Files (x86)\qfs\qftest\qftest-4.1.4\jython\Lib\qftest.py", line 172, in evaltest

    exec "if " + test + ": ret[0]='true'" \

  File "<string>", line 1

    if rc.getComponent("label0.00").getAttribute(?value?) != "0.00": ret[0]='true'

                                                ^

SyntaxError: no viable alternative at character '?'

 

                at de.qfs.apps.qftest.run.AbstractRunContext.evalTest(SourceFile:4610)

                at de.qfs.apps.qftest.step.IfSequence.exec(SourceFile:381)

                at de.qfs.apps.qftest.step.IfSequence.exec(SourceFile:354)

                at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:2230)

                at de.qfs.apps.qftest.step.BasicSequence.a(SourceFile:752)

                at de.qfs.apps.qftest.step.TryStep.exec(SourceFile:268)

                at de.qfs.apps.qftest.step.TryStep.exec(SourceFile:221)

                at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:2230)

                at de.qfs.apps.qftest.step.BasicSequence.a(SourceFile:752)

                at de.qfs.apps.qftest.step.BasicSequence.exec(SourceFile:677)

                at de.qfs.apps.qftest.step.BasicSequence.exec(SourceFile:657)

                at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:2230)

                at de.qfs.apps.qftest.step.BasicSequence.a(SourceFile:752)

                at de.qfs.apps.qftest.step.BasicSequence.exec(SourceFile:677)

                at de.qfs.apps.qftest.step.BasicSequence.exec(SourceFile:657)

                at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:2230)

                at de.qfs.apps.qftest.step.TryStep.exec(SourceFile:308)

                at de.qfs.apps.qftest.step.TryStep.exec(SourceFile:221)

                at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:2230)

                at de.qfs.apps.qftest.step.BasicSequence.a(SourceFile:752)

                at de.qfs.apps.qftest.step.BasicSequence.exec(SourceFile:677)

                at de.qfs.apps.qftest.step.SetupSequence.exec(SourceFile:176)

                at de.qfs.apps.qftest.step.BasicSequence.exec(SourceFile:657)

                at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:2230)

                at de.qfs.apps.qftest.step.Dependency.exec(SourceFile:773)

                at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:2230)

                at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:3124)

                at de.qfs.apps.qftest.run.an$a.a(SourceFile:1357)

                at de.qfs.apps.qftest.run.an.a(SourceFile:217)

                at de.qfs.apps.qftest.run.AbstractRunContext.resolveDependencies(SourceFile:4834)

                at de.qfs.apps.qftest.step.Dependency.exec(SourceFile:757)

                at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:2230)

                at de.qfs.apps.qftest.step.DependencyReference.exec(SourceFile:460)

                at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:2230)

                at de.qfs.apps.qftest.step.TestCase.exec(SourceFile:616)

                at de.qfs.apps.qftest.step.TestCase.exec(SourceFile:402)

                at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:2230)

                at de.qfs.apps.qftest.step.TestSet.exec(SourceFile:1146)

                at de.qfs.apps.qftest.step.TestSet.exec(SourceFile:657)

                at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:2230)

                at de.qfs.apps.qftest.step.BasicSequence.a(SourceFile:752)

                at de.qfs.apps.qftest.step.RootStep.exec(SourceFile:1258)

                at de.qfs.apps.qftest.step.BasicSequence.exec(SourceFile:657)

                at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:2230)

                at de.qfs.apps.qftest.run.AbstractRunContext.run(SourceFile:1450)

                at de.qfs.apps.qftest.run.AbstractRunContext.run(SourceFile:1335)

                at de.qfs.apps.qftest.run.AbstractRunContext$a.run(SourceFile:11642)

Caused by: Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "C:\Program Files (x86)\qfs\qftest\qftest-4.1.4\jython\Lib\qftest.py", line 172, in evaltest

    exec "if " + test + ": ret[0]='true'" \

  File "C:\Program Files (x86)\qfs\qftest\qftest-4.1.4\jython\Lib\qftest.py", line 172, in evaltest

    exec "if " + test + ": ret[0]='true'" \

  File "<string>", line 1

    if rc.getComponent("label0.00").getAttribute(?value?) != "0.00": ret[0]='true'

                                                ^

SyntaxError: no viable alternative at character '?'

 

                at org.python.core.ParserFacade.fixParseError(ParserFacade.java:95)

                at org.python.core.ParserFacade.parse(ParserFacade.java:205)

                at org.python.core.Py.compile_flags(Py.java:1998)

                at org.python.core.Py.exec(Py.java:1432)

                at qftest$py.evaltest$6(C:\Program Files (x86)\qfs\qftest\qftest-4.1.4\jython\Lib\qftest.py:177)

                at qftest$py.call_function(C:\Program Files (x86)\qfs\qftest\qftest-4.1.4\jython\Lib\qftest.py)

                at org.python.core.PyTableCode.call(PyTableCode.java:167)

                at org.python.core.PyBaseCode.call(PyBaseCode.java:189)

                at org.python.core.PyFunction.__call__(PyFunction.java:446)

                at org.python.pycode._pyx36.f$0(<string>:1)

                at org.python.pycode._pyx36.call_function(<string>)

                at org.python.core.PyTableCode.call(PyTableCode.java:167)

                at org.python.core.PyCode.call(PyCode.java:18)

                at org.python.core.Py.runCode(Py.java:1391)

                at org.python.core.Py.exec(Py.java:1435)

                at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:268)

                at de.qfs.apps.qftest.shared.script.JythonEngine.exec(SourceFile:177)

                at org.apache.bsf.BSFManager$6.run(Unknown Source)

                at java.security.AccessController.doPrivileged(Native Method)

                at org.apache.bsf.BSFManager.exec(Unknown Source)

                at de.qfs.apps.qftest.run.AbstractRunContext.evalTest(SourceFile:4591)

                ... 46 more

 

 

So how do I compare the component’s displayed value with 0.00?

 

Cheers

Kevin