StartseiteEnglishKontakt
Informationen über itcampus und die PartnerKnowledgebaseSupport, FAQ, Tutorial und HandbuchDemoversion, Evaluationsversion, Whitepaper, Preise und ShopFeatures, Technische Details, Funktionsüberblick, Tutorialvideo und ScreenshotsNews
« Neues Beta Release 1.0.243
Bevorstehendes Ende der Public Beta von web2test - kleine Roadmap »

Browser-Interface web2test - Fortsetzung

Um Testfälle zu modellieren gibt es zahlreiche Möglichkeiten. In speziellen Fällen ist der konsequenteste und eleganteste Weg einen Negativ-Test zu spezifizieren. In web2test gibt es dazu zahlreiche Varianten, in Abhängigkeit vom zum überprüfenden Attribut.
Dazu gibt es in der aktuellen Version von web2test in der Standardsuite itc.w2t im Paket itc.check zwei neue Prozeduren. Beide Prozeduren berücksichtigen auch die Informationen über Sichtbarkeit der jeweiligen Attribute. Das ist ein grundlegender Aspekt um sehr spezifische Tests für DHTML/Ajax basierte Web-Applikationen modellieren zu können. Siehe auch:
DHTML / Ajax vs. Sichtbarkeit von Inhalten einer Website

Prozedur checkText(negative)

Negates a normal Textcheck to allow NegationChecks.
It writes an error into the run-log, if the check fails.

Parameter:

  • id - The id of the component.
  • value - The value that should “NOT” be the Text of the Component.

Prozedur checkElements(negative)

Negates a normal Elementcheck in select elements to allow NegationChecks.
It writes an error into the run-log, if the check fails.

Parameter:

  • id - The id of the component.
  • value - The value that should “NOT” be the Text of one element the Component.


Die Prozedur checkElements(negative) ist ebenfalls ein gutes Beispiel für die Verwendung des Browser-Interface. Nachfolgend der Jython Code dieser Prozedur:

node = rc.getComponent(rc.lookup(’id’))

if not node.isShowing():
rc.logWarning(”The target component ‘%s’ is not visible” % node)

val = rc.lookup(’value’)
iCount = node.getChildCount()
index = 0

while index < iCount:
element = node.getChild(index)
if element.getSimpleText() == val:
if not element.isShowing():
rc.logWarning(”The target component ‘%s’ is not visible but present” % val)
else:
rc.logError(”Check elements(negative) for %s failed” % val)
break
index += 1


Um einen Negativ-Test in eine Testsuite zu integrieren kann man folgendermaßen vorgehen:

  • Knoten einfügen > Prozedurknoten > Prozeduraufruf
  • itc.w2t > Package itc > Package checks > Prozedur checkElements(negative)

Im entsprechenden Prozeduraufruf müssen folgende Variablen gesetzt werden:

  • id: id des Attributes (Element aus dem Baum “Fenster und Komponenten”)
  • value: Der Wert, der NICHT vorkommen darf

Eine Antwort auf “Browser-Interface web2test - Fortsetzung”

  1. Web2Test &#187 News & Blog sagt:

    [...] An overview about each valid HTML tag an all reasonable checks can be found in the manual, chapter 4.6 Checks for HTML tags. Additional possibilities for enhanced checks can be found in the blog article: Browser Interface web2test - continuation [...]

Hinterlassen Sie eine Antwort