MantisBT - TestLink
View Issue Details
0008638TestLinkAPI - RESTpublic2019-04-18 09:362019-04-18 14:03
prabhatranjan2206 
fman 
urgentfeature requestsometimes
closedunable to reproduce 
1.9.19 (2019 Q1) 
 
MySQL
Chrome
TBD
0008638: How to indicate that the test case and each test steps have passed or not?
Unable to locate the the test step result for every test step and only it will reflect on whole some the test suite is passed or fail. I cannot update individually each test step as passed or failed

Code:

To validate gmail verification.

 package com.prabhat.demotestng;

import org.testng.annotations.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import testlink.api.java.client.TestLinkAPIClient;
import testlink.api.java.client.TestLinkAPIException;
import testlink.api.java.client.TestLinkAPIResults;
public class TestLink
{
    public static String DEVKEY="1f2acd018abc020729b20b457360bdba";
    public static String URL="http://localhost/testlink/lib/api/xmlrpc/v1/xmlrpc.php"; [^]

    public static void reportResult(String TestProject,String TestPlan,String Testcase,String Build,String Notes,String Result) throws TestLinkAPIException
    {
        TestLinkAPIClient api=new TestLinkAPIClient(DEVKEY, URL);
        api.reportTestCaseResult(TestProject, TestPlan, Testcase, Build, Notes, Result);
    }

    @Test
    public void Test1()throws Exception
    {
        TestLink a=new TestLink();
        System.setProperty("webdriver.chrome.driver", "C:\\Users\\windev\\Desktop\\selenium\\chromedriver.exe");
        WebDriver driver=new ChromeDriver();
        WebDriverWait wait=new WebDriverWait(driver, 600);
        String testProject="WebAutomation";
        String password= "example@248";
        String testPlan="WebAutomation Test Plan";
        String testCase="Gmail Login Test Cases";
        String build="Gmail Login";
        String notes=null;
        String result=null;
        String executionnotes=null;
        String executionresult=null;
        try
        {
            driver.manage().window().maximize();
            driver.get("https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1&ltmpl=default&ltmplcache=2&emr=1" [^]);
            driver.findElement(By.xpath(".//*[@id='identifierId']")).sendKeys("example@gmail.com");
            Thread.sleep(2000);
            driver.findElement(By.id("identifierNext")).click();
            Thread.sleep(2000);
            driver.findElement(By.xpath(".//*[@id='password']/div[1]/div/div[1]/input")).sendKeys(password);
            Thread.sleep(2000);
            driver.findElement(By.id("passwordNext")).click();
            Thread.sleep(2000);
            driver.switchTo().defaultContent();
            //wait.until(ExpectedConditions.visibilityOfElementLocated(By.linkText("+Testlink")));
            result= TestLinkAPIResults.TEST_PASSED;
            notes="Executed successfully";
        }

        catch(Exception e)
        {
            result=TestLinkAPIResults.TEST_FAILED;
            notes="Execution failed";
        }
    
        finally
        {
            a.reportResult(testProject, testPlan, testCase, build, notes, result);
            driver.quit();
        }
    }
}
No tags attached.
Issue History
2019-04-18 09:36prabhatranjan2206New Issue
2019-04-18 14:03fmanNote Added: 0028736
2019-04-18 14:03fmanQA Team - Task Workflow Status => TBD
2019-04-18 14:03fmanStatusnew => closed
2019-04-18 14:03fmanAssigned To => fman
2019-04-18 14:03fmanResolutionopen => unable to reproduce

Notes
(0028736)
fman   
2019-04-18 14:03   
how to questions => forum