Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99409

How to capture internal assertion in TestNG

$
0
0

I'm fairly new to Java, Selenium and TestNG, please bare with me if the question is basic. I'm looking for a way of capturing internal assertion happening TestNG. Consider the following structure

@WebTest
@Test(groups = {"main_feature"} )
public void Check_Home_page () {
    flow.login();  //Inside login() we do assertion to find login was successful
    flow.ValidateProfilePic(); //Inside ValidateProfilePic() we do assertion to find picture section is available
}

we will run xml file as follows

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Smoke Result" parallel="false" thread-count="0">
<parameter name="seleniumHub" value="false" />
<parameter name="hubUrl" value="http://someurl:1144/wd/hub" />

<test name="Test Run">
    <parameter name="webPageUrl" value="http://mttesting.com" />
    <parameter name="browser" value="chrome" />
    <groups>
        <run>
            <include name="main_feature" />
        </run>
    </groups>
    <classes>
        <class name="test.HomeTest" />
    </classes>
</test>

<listeners>
    <listener class-name="selenium.DefaultCapability"></listener>
    <listener class-name="selenium.WebCapability"></listener>
    </listeners>
</suite>

Once the execution get over in the report we should be able to see like

  • Testcases Run : 2, failure : 0 Check_Home_page

  • login(passed)

  • ValidateProfilePic(passed)

Now, when i run, i get Testcase Run : 1 and internal assertion(i don't know what to call this) are not in the picture at all.

If there is a way to achieve this, please advise.


Viewing all articles
Browse latest Browse all 99409

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>