My testcases are skipped with no cause. Am new to testng and did nothing regarding 'skip test' in my code.

3,539 views
Skip to first unread message

Jerald paul

unread,
Oct 15, 2011, 10:54:31 AM10/15/11
to testng...@googlegroups.com
Hi,

My testcases are skipped with no cause. Am new to testng and did nothing regarding 'skip test' in my code. But still wondering why my test cases are skipped in the final report.

thanks
jerald

Ansgar Konermann

unread,
Oct 15, 2011, 12:34:22 PM10/15/11
to testng...@googlegroups.com

Please post the actual error messages you get, and the commands you issued to run your tests.

Am 15.10.2011 17:52 schrieb "Jerald paul" <paulj...@gmail.com>:

Jerald paul

unread,
Oct 17, 2011, 3:00:53 AM10/17/11
to testng...@googlegroups.com
Hi i have attached the reports i generated using ant.  Am using testng for running my selenium tests. please help.


SKIPPED CONFIGURATIONS
Test methodExceptionTime (seconds)Instance
setUp
Test class: selenium.com.test.admin.tests.ScriptingAddUserGroup

0selenium.com.test.admin.tests.ScriptingAddUserGroup@1301ed8
setUp
Test class: selenium.com.test.admin.tests.ScriptingAddUser

0selenium.com.test.admin.tests.ScriptingAddUser@152544e
setUp
Test class: selenium.com.test.admin.tests.ScriptingAddUser

0selenium.com.test.admin.tests.ScriptingAddUser@152544e
setUp
Test class: selenium.com.test.admin.tests.ScriptingAddUser

0selenium.com.test.admin.tests.ScriptingAddUser@152544e
setUp
Test class: selenium.com.test.admin.tests.ScriptingMailServer

0selenium.com.test.admin.tests.ScriptingMailServer@ece65
tearDown
Test class: selenium.com.test.admin.tests.ScriptingAddUserGroup

0selenium.com.test.admin.tests.ScriptingAddUserGroup@1301ed8
tearDown
Test class: selenium.com.test.admin.tests.ScriptingAddUser

0selenium.com.test.admin.tests.ScriptingAddUser@152544e
tearDown
Test class: selenium.com.test.admin.tests.ScriptingAddUser

0selenium.com.test.admin.tests.ScriptingAddUser@152544e
tearDown
Test class: selenium.com.test.admin.tests.ScriptingAddUser

0selenium.com.test.admin.tests.ScriptingAddUser@152544e
tearDown
Test class: selenium.com.test.admin.tests.ScriptingMailServer

0selenium.com.test.adm

This is the error message u got in the reports.

Cédric Beust ♔

unread,
Oct 17, 2011, 3:13:16 AM10/17/11
to testng...@googlegroups.com
You already told us that, we can't help you without seeing the code you are trying to run, trimmed down.

-- 
Cédric






--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/UoeXtuAwPxoJ.

To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

jerald

unread,
Oct 17, 2011, 3:45:03 AM10/17/11
to testng...@googlegroups.com
hi,

Here is my testng code -

package selenium.com.testnet.pmp.admin.tests;

import java.util.List;
import java.util.NoSuchElementException;

import org.openqa.selenium.support.PageFactory;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import selenium.com.testnet.pmp.admin.pages.AddUserGroupPage;
import selenium.com.testnet.pmp.admin.pages.AdminListPage;
import selenium.com.testnet.pmp.resources.pages.CommonPage;
import selenium.com.testnet.pmp.resources.pages.ErrorPage;
import selenium.com.testnet.pmp.resources.tests.PMPTestCase;
import selenium.com.testnet.pmp.util.Util;

public class ScriptingAddUserGroup extends PMPTestCase
{
    CommonPage cPage;
    ErrorPage ePage;
    AdminListPage aPage;
    AddUserGroupPage ugPage;

    @BeforeMethod
    @Override
    public void setUp() throws Exception
    {
    super.setUp();
    cPage = PageFactory.initElements(driver, CommonPage.class);
    ePage = PageFactory.initElements(driver, ErrorPage.class);
    aPage = PageFactory.initElements(driver, AdminListPage.class);
    ugPage = PageFactory.initElements(driver, AddUserGroupPage.class);
    }

    @Test(description = "Test user group name mandatory check")
    public void TestAddUserGroup_GroupNameMandatoryCheck() throws Exception
    {
    List<String> csrfStrList = Util.getCsrfStrings();
    int count = 0;
    StringBuffer sb = new StringBuffer();
    // This is just a property added in build.xml
    String path = System.getProperty("selenium_tests_src");
    String lineBreak = "<br>";
    if (path == null)
    {
        lineBreak = "\n";
    }
    sb.append(lineBreak);
    for (String s : csrfStrList)
    {
        count++;
        try
        {
        // Goto 'Add users group' page
        getAddUserGroupPage();
        // Scripting group name
        ugPage.enterGrpName(s);
        // Click on 'Save' button
        ugPage.clickSubmitBtn();
        // Check error page elements and report if elements present or
        // not.
        ePage.checkErrorPageElements2();
        // Click on 'Go Home' button
        ePage.clickHomeBtn();
        }
        catch (NoSuchElementException e)
        {
        if (e.getMessage().contains("errorTitle") || e.getMessage().contains("uni_button"))
        {
            sb.append("Error page is not shown for the " + count + " input " + s).append(lineBreak);
        }
        }
        catch (Exception e)
        {
        // sb.append(e.getMessage()).append(lineBreak);
        }
    }
    if (sb.length() > 5)
    {
        setVerificationErrors(sb);
    }
    // Goto 'Add Users Group' page
    getAddUserGroupPage();
    // Click on 'Save' button
    ugPage.clickSubmitBtn();
    // Get the error message
    String errMsg = ugPage.getGrpNameErrMsg();
    errMsg = Util.getSafeString(errMsg);
    if (!errMsg.equalsIgnoreCase("Invalid group name"))
    {
        Assert.fail("Expected error message 'Invalid group name' and actual error message '" + errMsg + "'");
    }
    }

    private void getAddUserGroupPage()
    {
    // Click on admin tab
    cPage.clickAdminTabLink();
    // Click on users link
    aPage.clickUsers();
    // Click on 'User Group' link
    ugPage.clickUsersGrpLink();
    // Click on 'Add User Group' btn
    ugPage.clickAddGroupBtn();
    // Check add users page
    ugPage.checkAddUserGroupPageElements();
    }
}

And i use the default testng.xml gnenerated by eclipse. I use to add tags when i add a new testng class to the project. please help.

Thanks and Kind Regards
jerald



2011/10/17 Cédric Beust ♔ <ced...@beust.com>

Tomek Kaczanowski

unread,
Oct 17, 2011, 2:37:37 PM10/17/11
to testng...@googlegroups.com
aren't you eating some exceptions?

catch (Exception e)
{
// sb.append(e.getMessage()).append(lineBreak);
}

--
Regards / Pozdrawiam
Tomek Kaczanowski
http://kaczanowscy.pl/tomek


2011/10/17 jerald <paulj...@gmail.com>

--
Regards / Pozdrawiam
Tomek Kaczanowski
http://kaczanowscy.pl/tomek

Jerald paul

unread,
Oct 18, 2011, 12:19:42 AM10/18/11
to testng...@googlegroups.com
yes off course. Is this a problem in my case? i used junit4 before and all my test cases ran successfully. And then i migrated from junit to testng because of the better reports. Now some of my testcases are skipped. I dont know really why. If this is the cause, What should i do?

Regards
jerald

Tomek Kaczanowski

unread,
Oct 18, 2011, 2:43:12 AM10/18/11
to testng...@googlegroups.com
> yes off course. Is this a problem in my case?
Maybe yes, maybe no, I can't tell. Please stop eating exceptions and
then you will see if there is something going on there.

--
Regards / Pozdrawiam
Tomek Kaczanowski
http://kaczanowscy.pl/tomek

i used junit4 before and all
> my test cases ran successfully. And then i migrated from junit to testng
> because of the better reports. Now some of my testcases are skipped. I dont
> know really why. If this is the cause, What should i do?
>
> Regards
> jerald
>

> --
> You received this message because you are subscribed to the Google Groups
> "testng-users" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/testng-users/-/5Q_9x0LDGR0J.

Reply all
Reply to author
Forward
0 new messages