Generating urls for specific filter settings (REST API)

Answered

Comments

5 comments

  • Ragnar Engnes

    One solution is to use the API to query the test results. Here is an example:

            [TestMethod]

            [TestCategory("Develop")]

            public void LoadUUTReport()

            {

                TDM api = new TDM();

                api.InitializeAPI(true);

                WatsReportHeader[] h = api.FindReports("(PN eq 'FATPartNo') and (ReportType eq 'UUT')", 1);

                Assert.AreEqual(1, h.Length);

                UUTReport r = (UUTReport)api.LoadReport(h[0].Guid.ToString());

                Assert.IsTrue(r.SerialNumber.StartsWith("FATTest"));

     

                UUTPartInfo[] pInfo = r.PartInfo;

                Assert.AreEqual(2, pInfo.Length);

     

                Step[] allSteps = r.AllSteps;

                Step[] failedSteps = r.FailedSteps;

                Step[] specificSteps = r.FindSteps("SinglePass", "/pass/fail tests/");

     

                SequenceCall[] allSequenceSteps = r.AllSteps.OfType<SequenceCall>().ToArray();

     

                NumericLimitStep stepOfInterest = r.AllSteps.Where(s => s.Name == "SingleGELEFail").FirstOrDefault() as NumericLimitStep;

                Assert.IsNotNull(stepOfInterest);

                NumericLimitTest numericLimitTest = stepOfInterest.Tests[0];

                Assert.AreEqual(500, numericLimitTest.NumericValue);

                Assert.AreEqual(501, numericLimitTest.LowLimit);

                Assert.AreEqual(502, numericLimitTest.HighLimit);

     

                StringValueStep stringValueStepFromMultiple = r.AllSteps.Where(s => s.Name == "Multiple tests" && s.StepPath == "/stringvalue tests/").FirstOrDefault() as StringValueStep;

                Assert.IsNotNull(stringValueStepFromMultiple);

                StringValueTest stringValueTest = stringValueStepFromMultiple.Tests.Where(t => t.MeasureName == "MultiCasePass").FirstOrDefault();

                Assert.IsNotNull(stringValueTest);

                Assert.AreEqual("CaseSensitive", stringValueTest.StringValue);

                Assert.AreEqual("CaseSensitive", stringValueTest.StringLimit);

     

                Step graphStep = r.FindSteps("Fibionacci", null).First();

                Chart chart = graphStep.Chart;

                double[] xValues, yValues;

                chart.Series[0].GetValues(out xValues, out yValues);

                Assert.AreEqual(13, xValues.Length);

     

                Attachment attachment = r.FindSteps("Attach file", null).First().Attachment;

                Assert.AreEqual("winhlp32.exe", attachment.FileName);

                Assert.IsTrue(attachment.Data.Length > 10);

     

            }

     

     

    0
    Comment actions Permalink
  • Czyzewska Bogna

    Hi Ragnar,
    Thank you, but if I'm reading this code correctly, it'll only work to download raw report data. Yield reports, test & step analysis and so on are still out of reach.

    0
    Comment actions Permalink
  • Permanently deleted user

    That's exactly I'm looking for as well.
    I would like to be able to paste such a link into a test report ,Jira story or in Confluence.

    0
    Comment actions Permalink
  • Tommy Egeberg

    Hi.

    You may get the result you want in the rest API.

    The app section have actions to list UUTs or get yield calculations by a filter.

     

    You may also try to generate your own links with help of the "share filter" behavior. You will manually have to base64 encode your filter.

    Ex.

    https://virinco.skywats.com/dist/#/reporting/test-repair/uut-report?filter=eyJzZXJpYWxOdW1iZXIiOiIxMjM0NTY3OTgiLCJwYXJ0TnVtYmVyIjoiMTIzIiwicmV2aXNpb24iOiJBIiwiZGF0ZUZyb20iOiIyMDE5LTA4LTI4VDAwOjAwOjAwIn0=

     

    The base64 encoded part looks like this:

    {"serialNumber":"123456798","partNumber":"123","revision":"A","dateFrom":"2019-08-28T00:00:00"}

     

     

     

    0
    Comment actions Permalink
  • Permanently deleted user

    What I meant is that it would be awesome if we can fill up the filter parameters over the URL.
    Because if I do a "Test step yield & analysis" and if I want to refer this results into a report then it would be great if I could add a link in this report which would lead to the results on Wats.
    Now I need to write down all the required filter parameters into the report that others are able to reproduce these results in Wats.
    One approach would be to make a specific filter but to make a filter for each reference it would end up in a mess.

    0
    Comment actions Permalink

Please sign in to leave a comment.