简体   繁体   中英

Java method wrapping with keywords

I am writing a Java keyword driven framework. In that I have one keyword Java class which I am calling in another Java test class.

KeywordClass doactionobje = new KeywordClasss();
doactionObje.click(parameter1,...);

Now I am looking to wrap this method calling in single keyword. For eg doactionObje.click should be only click similar doactionobje.input to only input .

New code will look like

click parameter1, parameter2

I want to achieve this to make test script writing easier for those who do not have much coding experience.

I would also like to know about your thoughts on performance of script execution and other maintenance over ahead.

The directive you might be looking for is import static , ie

import static java.util.Collections.*; 

will import all the static methods from the java.util.Collections class. However, there is no way to do this for non-static methods.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM