To create generic keyword


I need to create generic keyword
Login and Update page
${current_test}= Set Variable Current test case: ${TEST NAME}
Log ${current_test}
…Common logic

Some logic

                           If ${currentTest} == 'Login'
                                        to do business logic
                            Else IF ${currentTest} == 'Update Name'
                                    to do business logic

But both if else condition is executing in both Login and Update Name test.

Hi Surya,

So you simply create a third keyword, put that if block in the new keyword and then replace that if block with the new keyword’s name in both the other 2 keywords.


1 Like