breaking Tests up correctly

Answered

I created various methods in a Package called ‘Framework’. Then from another Package I call the methods.  All works but when the script runs I get just 1 Test.  I was thinking each @Test method would be a test. Is my design bad.  Do I need to create a new Class to cll each method within the Package SFModules?


package FrameWork;

 

import  – various import statements

 public class SFAccounts

@Test

public static void Login(String sUserName, String sPassword)

 Login code

@Test

public static void SFTab(String sUserName, String sPassword)

Tab code

@Test

public static void accountSearch (strAccountnamerd)

Search code

Then from another package I call my methods :
package SFModules;

public class sfdc {

public static void EndtoEnd() throws Exception {

 SFAccounts.Login(sUserName,sPassword);

SFAccounts.SFTab(tabName);

SFAccounts.accountSearch(strAccountname);

 

Add Comment
  • 2 Answer(s)
    Best answer

    Hello Richard,

    I do not know if you are aware of Page Object Model design pattern for designing your framework.
    This design divides Business and Tests and will be very easy to maintain and debug for future changes or business challenges.

    My advice please look on to it and then see how you can implement your tests, I am sure it will be very easy for you to understand.

    Thanks,
    Ankur

    Train Answered on August 30, 2015.
    Add Comment

    Hi Richard,

    Instead of providing @Test Annotation in ‘package FrameWork’ you can try providing in package SFModules(Above the calling method).

    Thanks,
    Revathi

    Train Answered on August 27, 2015.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.