Verify BUG exists when Test Case OUTCOME is not equal to "PASSED" - testing

How do I provide a list of Test Case(s) whose OUTCOME is not equal to "PASSED" and an associated BUG does not exist?
Can I write a Query?

Related

TFS Test Hub - Requirements-Based Suite not updating count

Test cases are created in iterations with our sprint cycles. They are then added to a test plan via requirements-based query for our integration and system testing.
At the end of every sprint and leading up to integration and system testing, the requirements-based query is run repeatedly against the same same static test suite to add any newly created test cases to the test plan.
The requirements-based query will see the new items and add them to the test plan, however, anywhere that displays the total count of test cases in the test plan or suites does not update automatically. This includes counts shown in TFS web GUI ("Show count from child tests"), MTM, and any dashboard charts.
The only way to get that count to update is to manually click on each test suite generated from the requirements-based suite.
Repro Steps:
Create Test Plan - "Test Plan A"
Create Static Suite in newly created Test Plan - "Static Suite B"
Right click on "Static Suite B" and select "New requirements-based suite"
Fill out criteria for requirements-based suite. My query: Top Level: 'Work Item Type - In Group - Feature/Requirement/Bug Categories' and 'Release Number = XX.XX'. Linked Work Items: 'Work Item Type = Test Case'. 'Return all top level items' is selected.
Run query. Results display in grid, including top level items that do not yet have test cases but are assigned to upcoming release.
Select all results in the grid.
Select "Create Suites". Suites are created for all items included in the release, including items that do not yet have test cases. Note the total count of test cases in "Static Suite B". This count will display in any charts for this test plan and/or suite.
Add a test case for an item that is included in the release but did not have a test case during prior step. Note the top level item for upcoming step.
Navigate back to "Test Plan A".
Right click on "Static Suite B" and select "New requirements-based suite"
Query used in Step 4 displays. Do not make any changes to the query.
Run query again. Results display in grid for all top level items, including those that do not yet have test cases but are assigned to upcoming release. Newly created test case should display in the results.
Select all results and select "Create Suites". No new suites are created since they were created in Step 6 above. Do not select existing requirements based suite for the test case that was added in Step 8.
Check the total count of test cases in "Static Suite B" and any test plan/suite charts. Observe count has not incremented per new test case.
Navigate to "Static Suite B" and select the requirements-based suite where test case was added in Step 7. Observe test case displays in the requirements-based suite as expected.
Check the total count of test cases in "Static Suite B" and any test plan/suite charts. Observe count is not incremented per new test case.
Screenshot of requirements-based query and results (obfuscated)
Screenshot of counts that do not update (obfuscated)
Has anyone else encountered this and have a fix/work-around?
Using local TFS Version 16.122.27102.1.

How to Execute Selenium Selenium Test Cases based on Excel Flag. If Yes only then run the test cases and write the Pass/Fail result in excel

I have one Excel file in which there is Test Case Name, Test Case description, Data, Flag and Result.
I want to execute only those test cases which have Flag set as 'Y' and skip rest of all the test cases where Flag is equal to 'N'.
Also, once executed need to write the Status as Pass/Fail/Skipped.
Is it possible to achieve by Selenium?
Any help/code would be appreciated. If someone has done this in his/her framework kindly share the logic.

SQL - Need to find a way to check whether a member has renewed

So, this is probably simple. I need to find a way to check whether a member of a scheme has renewed their membership or let it expire, I need to generate a simple list of those whom have not renewed.... There are complicating factors however, in that I cant use Excel, and it can only be a single step to Crystal reports (though I have solved the issue in Excel using a simple Countifs and if Formula)
Now for the problem.
The membership has specified Start/End Dates in separate columns in the table. It is easy to see whether this, in a row basis has expired. The issue is that if they have renewed, this is logged as a separate table entry linked by a Individual reference to the member. There are also multiple Qualifications I also need to test against.
So, whilst I can test the expiration date, the question is how can I test against the rest of the data, based on whether the Individual Reference and Qualification name and then check whether this is "Current". Doing this would enable me to therefore test whether the Membership has therefore been renewed, or not, on an individual line.
Any advice on methods would be appreciated.
Without knowing what data you have and making assumptions out the wazoo, try something along these lines
select distinct Member_id,
case
when exists (select 1
from members m2
where m2.member_id = m1.member_id
and (m2.expiry_date is null
or m2.expiry_date > '2018-01-25'))
then 'Active'
else 'Expired'
end as mem_status
from members m1
What the exists does is look and see if that member has an active status

How to group records where a subset matches a condition

I have created a Microsoft report in VS2008 that displays details of products that are tested in a factory. Relevant fields to this problem are: SerialNumber (int), Pass (bool).
There is also a record ID which means several entries may exist per SerialNumber.
What we would like the report to show is to be grouped where SerialNumbers have never met the condition Pass=True (i.e. actual rejects) and the rest under where at least one record shows Pass=True.
The expression for the grouping currently is "=Fields!Pass.Value" which splits pass and fail records (and are then sorted etc).
In case anyone else comes up against this and wants to know how I solved it, I added an extra boolean column to the SQL query called 'Reject' which returns true or false and used this to group the report.
As powerful as the reporting can be, it just appears to be quite limited on what it can do with set data beyond Count, CountDistinct etc.

tests for data access (sql queries) functionality

I want to know the best way of testing data access functionality.
I know that it is possible to create mocks to change data layer objects that is using to test business logic.
However is it possible to test if sql queries to database are correct.
Scenario: A method must return employees which were applied for work last month.
I can return list of object and check if each employee's startDate property is correct (last month).
So if it returns 3 employees and they have correct startDate value but there are more two employee in database which aren't returned. How to write test for that case? :)
Thanks in advance.
You set up the test DB so you shold know what data is in it. If you expect 5 employees to be returned from the query and you get only 3, you know there is an error.
You can test the query with different setups: empty table, only new employees, only old employees, a mix of the two (with special care to the borderline cases), etc.
I don't think you need to check the two other employees in the database which aren't returned.
The key is, when setting up your test data, you would want to ensure you have enough records that don't match the criteria (in addition to the records that do match), then you run the fetch and make sure you get back the correct number of records that do match the criteria.
Preparing the test data in this manner ensures that your method is returning the expected results.