简体   繁体   中英

Architecture for implementing functionalities of two classes to a third class using selenium

I have a package named org.TestDemo and created 3 different test scripts using selenium webdriver which are given below;

1. LoginTest.java
2. Privillege.java
3. Alerts.java

In LoginTest.java class I have created positive test scenarios for login functionality in Privillege.java class I have done some user privilege scenarios and in Alerts.java ,provided some alert functionality.

When I run Alerts.java class ,I just want to call both the other two classes from Alerts.Java class to inherit the functionality in LoginTest.java & Privillege.java

So what architecture should I follow to implement this task ?

Maybe I don't understand what you need, but instead of inherit LoginTest and Privillege - can u just use/call their functionality into your Alerts (keep instances of LoginTest and Privillege)? If they are in same package - this shouldn't be a problem. In my experience I've always consider creation and usage of BaseTest.java wich helps me to share test_logic in my architecture.

In case you need some more complex logic you can always try use Decorator or try Mediator .

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