waitByXPath Taurus command stopped working after July 11, 2021 BlazeMeter release
search cancel

waitByXPath Taurus command stopped working after July 11, 2021 BlazeMeter release

book

Article ID: 220297

calendar_today

Updated On:

Products

BlazeMeter

Issue/Introduction

Taurus XML scripts which contain waitByX commands executed from BlazeMeter after the July 11, 2021 release fail with errors similar to the following (as recorded in the test bzt.log file):

[2021-07-14 05:00:24,809 DEBUG root] TaurusInternalException: Could not build code for action: waitByXPath('//span[text()="Log In"]')
  File "/usr/local/taurus-cloud/python/lib/python3.8/site-packages/bzt/cli.py", line 272, in perform
    self.engine.prepare()
  File "/usr/local/taurus-cloud/python/lib/python3.8/site-packages/bzt/engine/engine.py", line 217, in prepare
    self.__prepare_provisioning()
  File "/usr/local/taurus-cloud/python/lib/python3.8/site-packages/bzt/engine/engine.py", line 620, in __prepare_provisioning
    self.provisioning.prepare()
  File "/usr/local/taurus-cloud/python/lib/python3.8/site-packages/bzt/modules/provisioning.py", line 72, in prepare
    executor.prepare()
  File "/usr/local/taurus-cloud/python/lib/python3.8/site-packages/bzt/modules/selenium.py", line 122, in prepare
    self.runner.prepare()
  File "/usr/local/taurus-cloud/python/lib/python3.8/site-packages/bzt/modules/apiritif/executor.py", line 62, in prepare
    self.script = self.__tests_from_requests()
  File "/usr/local/taurus-cloud/python/lib/python3.8/site-packages/bzt/modules/apiritif/executor.py", line 115, in __tests_from_requests
    builder.build_source_code()
  File "/usr/local/taurus-cloud/python/lib/python3.8/site-packages/bzt/modules/apiritif/generator.py", line 1940, in build_source_code
    self.tree = self._build_tree()
  File "/usr/local/taurus-cloud/python/lib/python3.8/site-packages/bzt/modules/apiritif/generator.py", line 1933, in _build_tree
    mod = self._gen_module()
  File "/usr/local/taurus-cloud/python/lib/python3.8/site-packages/bzt/modules/apiritif/generator.py", line 1224, in _gen_module
    stmts.append(self._gen_classdef())
  File "/usr/local/taurus-cloud/python/lib/python3.8/site-packages/bzt/modules/apiritif/generator.py", line 1321, in _gen_classdef
    class_body = [self._gen_test_methods()]
  File "/usr/local/taurus-cloud/python/lib/python3.8/site-packages/bzt/modules/apiritif/generator.py", line 1424, in _gen_test_methods
    body = [self._gen_transaction(request)]
  File "/usr/local/taurus-cloud/python/lib/python3.8/site-packages/bzt/modules/apiritif/generator.py", line 1611, in _gen_transaction
    body.append(self._gen_http_request(request))
  File "/usr/local/taurus-cloud/python/lib/python3.8/site-packages/bzt/modules/apiritif/generator.py", line 1672, in _gen_http_request
    action_lines = self._gen_action(action)
  File "/usr/local/taurus-cloud/python/lib/python3.8/site-packages/bzt/modules/apiritif/generator.py", line 738, in _gen_action
    raise TaurusInternalException("Could not build code for action: %s" % action_config)

 

Prior to the July 11, 2021 BlazeMeter release, these same test ran successfully but messages similar to the following were recorded message in the bzt.log files from these tests:

[2021-07-07 05:01:34,935 WARNING Engine.ApiritifScriptGenerator] Wait command is deprecated and will be removed soon. Use waitFor instead.

Environment

Release : SAAS

Component : BLAZEMETER PERFORMANCE TESTING

Cause

The 1.20.166 version of the taurus-cloud image was released on July 11, 2021.  This version contains the following Taurus components:

Taurus CLI Tool v1.15.3 / Build: 14125 Mon Jun 21 10:23:02 UTC 2021

Prior to July 11 the 1.20.162 version of the taurus-cloud image was in place.  The component versions in this release of Taurus are the same except for the build number of the Taurus CLI Tool.  In the older release this build number was:

Build: 14123 Tue Jun 15 03:18:18 UTC 2021

The taurus-cloud is using the open-source software Taurus, so decisions made by the maintainers of Taurus will affect BlazeMeter and are outside the control of the BlazeMeter engineering team.

It appears that the deprecated waitByX commands were fully removed in the 14125 Taurus build.

Resolution

The waitByX command had been replaced with the waitForByX command in the latest Taurus build.  The waitForByX command has the following syntax:

waitForByX(X_name, condition): timeout

where X is the action object (like XPath).  For further information on the use of the waitForByX command please review the Pause section of the Apiritif Taurus article.  Also note that the waitByX command is no longer even document in this article since it has been fully removed from Taurus.

For any Taurus YML scripts to run from BlazeMeter platform with the latest build of Taurus(after July 11, 2021), it will be necessary to update all of waitByX commands in existing tests and replace them with the appropriate waitForByX command.