posted 5 years ago I am completely new to automation testing and am fairly inexperienced at programming. I'm trying to design about 50 test cases - with most of them requiring the same block of code (Login to Dynamics NAV). Since I only want to write this block once, I tried to put it in a separate class and call it when needed.
What my program should do: Initialize several variables and open a browser. Then run the code in NAVLogin.java (login) and return.
What my program actually does: Initialize several variables and open a browser. Then open another browser, login and return.
Because I'm struggling to find a way to pass the driver (and other variables) from CUCR01.java into NAVLogin.java, I ended up having to re-initialize everything in NAV Login. I've tried a lot of things so far and would really appreciate if anyone can offer a helping hand.
CUCR01.java (my test case)
NAVLogin.java