Can i overwrite existing keyword method?i.e if i create same keyword in custom method, which will be executed?

i want to overwrite an existing keyword in custom keyword.

For example:

I am creating custom keyword: acceptAlert

which is already in Built-in keyword. My question is which one will be executed? or I cant create with the same name?

Suppose if I cant create with same name how can i overwrite built in method?

Is ther any way so that i can overwrite the existing keyword method?

I need to add a External log statement for each step

I am exactly looking for this one.

Is anyone can give an advice?

Thank you.

@Katehtk

Have a look at this post:

My custom keyword HighlightElement magically extends the built-in keywords such as WebUI.click(), WebUI.setText(), WebUI.selectOptionByValue() so that these keywords give highlight to the HTML node while keeping their own base function (clicking the node, setting a text into <input> node, etc) unchanged.

You want to develop your own custom keyword which extends the built-in keywords of your choice so that they do something additive while the original function retained. Please study the source code.

1 Like