TestProject Forum
Powered by leading experts in the test automation community

Duplicate Step and change element changes the original element

When I create a step, choose the action, name the element and give it the element path everything is fine. Then I duplicate that step and simply change the element name and the path, it automatically updates the original step I duplicated.

The reason why I go down this path at all is because often times, options from the add-ons I have installed, are not showing up in the list of element actions/actions.

Anyone running into these issues? What’s a workaround for this?

Hello @erick.caceres and thanks for reaching out to us.

That is most likely caused by the element being updated, being shared between these steps.
Elements in steps are basically their own variables. You can see these elements if you go the the elements section in your project and choose an application.

These are created either by your manually or most of the time by interacting with page elements.

If you duplicate an element action, it will use the same element variable, meaning if you update it for the duplicate, it will affect the original as well.

You can go around this, by creating a new element manually and using it in the action itself.

As for some actions not appearing on all elements, that is caused by them being made for different kinds of elements, and not being an option for the element type you’d like to use.

For example,

The web list operations actions, can only be used on those 3 types of elements.

1 Like

Thanks David, I understand now about the add-on not being available on certain elements. The web application I am working on seems to steer away from consistency because that means there are two lists/dropdowns in the same dialog that use different elements but do the same thing.
Is there a work around for something like that? I just need to be able to choose an option in the dropdown. I suppose I could use the action that moves the mouse to a certain position. Or send the ENTER key if there is only one option available in the dropdown.

About the duplicate steps - correct about step duplication also duplicating the element/variable. So when I duplicate the step, I change the element name and the xpath for that element to the element I am trying to manipulate in the web application Im testing. But when I edit the element name and the xpath/css selector, it changes the element for the step I duplicated and vice versa.

It sounds like the workaround is, instead of editing the element in the duplicated step, I have to go into my project and manually create a new element and then select that element when I duplicate the step and choose that newly created element. Sounds like a bug or no?

Thanks for the help!