Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'keywords' #521

Open
matthiasxv250 opened this issue Mar 7, 2023 · 0 comments
Open

AttributeError: 'keywords' #521

matthiasxv250 opened this issue Mar 7, 2023 · 0 comments

Comments

@matthiasxv250
Copy link

I'm using a custom data driver to fill my template test case with data from Jira. Running the test cases using robot everythink works correctly. Running them using pabot I get the following errors shown:

13:05:45 [ ERROR ] [ DataDriver ] Error in robot file:
13:05:45 File "C:\Develop\Skripte\tests\test.robot", line 0
13:05:45 [ ERROR ] Calling method '_start_suite' of listener 'DataDriver' failed: AttributeError: 'keywords' attribute is read-only and deprecated since Robot Framework 4.0. Use 'body', 'setup' or 'teardown' instead.

Results are same.

The data driver is quite easy:
class JiraTestcaseReader(AbstractReaderClass):

# This method will be called from DataDriver to get the TestCaseData list.
def get_data_from_source(self):
    jql = jira_helper.create_jql(
        project=self.kwargs['project_name'], test_aspect=self.kwargs['testsuite'], test_id_filter=self.kwargs['test_id'])
    issues = jira_control.search_issues(
        jql=jql, environment=self.kwargs['jira_environment'])

    for jira_test in issues:
        upload_dir_ = regex.sub(r'[\\/]', "/", os.path.join(ROBOT_OUTPUT_DIR, jira_test.key, 'temp'))
        screen_dir = regex.sub(r'[\\/]', "/", os.path.join(ROBOT_OUTPUT_DIR, jira_test.key, 'screenshot'))
        debug_dir = regex.sub(r'[\\/]', "/", os.path.join(ROBOT_OUTPUT_DIR, jira_test.key, 'debug'))
        args = {'${JiraIssueTestfall}': jira_test.key, '${TmpDir}': upload_dir_,
                '${ScreenDir}': screen_dir, '${DebugDir}': debug_dir}
        
        test_data.append(TestCaseData(f'{jira_test.fields.summary} - {jira_test.key}', args))

I need to replace the slashes using regular expresions otherwise creating the path with for example the Path-lib I get issues in the execution on linux. The path in my test do not have slashes and are invalid. Seems to be a bug too.
The reader does not have any further functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant