• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Pass WebDriver into a Class - Eclipse/Selenium

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)

Now I am super curious what sports would be like if we allowed drugs and tiny ads.
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic