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

[RFE] Ability to provide multiple values for 'target', 'value' or 'action' #11

Open
ganeshhubale opened this issue Apr 7, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@ganeshhubale
Copy link
Member

Description

  • We should have feature which allow user to provide more than one elements to target, more than one actions to perform and ability to input in more than one value in single step.
  • I came to know about this issue while filling sign up form where I have seen more than one fields like username, password, email etc.
  • According to present structure, we need to create different test step to add these values which increases efforts and steps in one test cases.
  • I expect to update structure of testscript as below:
  • See the target and value; provided list of values to it.
sequence:
- testcase 2
- testcase 3
- testcase 1
test:
- testcase 1:
  - scenario: close the browser
  - step 1:
      action: closebrowser
      name: closing browser window
      target: closebrowser
- testcase 2:
  - scenario: Visiting GitHub website
  - step 1:
      action: goto
      name: Provide GitHub website url to go to GitHub page
      target: https://github.com/
- testcase 3:
  - scenario: Creating GitHub account
  - step 1:
      action: import
      name: Go to GitHub website and click on sign up to visit registration page
      target: testcase 2
  - step 2:
      action: click
      name: click on sign up button
      target: Sign up
  - step 3:
      action: input
      name: Insert all the details
      target: ['//*[@id="user_login"]', '//*[@id="user_email"]']
      value: ['NewUser', '[email protected]']
      wait after action: 10

    @logger_decorator
    def input(self, test_data):

        targets = test_data['target']
        values = test_data['value']

        for i in range(len(targets)):
            test_data['target'] = targets[i]
            test_data['value'] = values[i]
            try:
                test_data = self.get_element(test_data)
                test_data["element_obj"].send_keys(test_data["value"])
            except Exception as e:
                logging.exception(e)
                test_data["error"] = True

        return test_data
  • Actually this works once we reach to particular page; But providing more than one urls as a target will be problematic.

@vishalvijayraghavan I would like to hear your thoughts on this feature.

@vishalvvr
Copy link
Collaborator

Hi Ganesh,
Yes this feature is good but better to create new action with name "inputform " or "forminput" likewise which will server this feature. I have recently added targets attribute to all action which have multiple fallback xpath and again if we add this feature to same input action it might get complicated.

@vishalvvr vishalvvr added the enhancement New feature or request label Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants