Highlighted
Respected Contributor.
Respected Contributor.
455 views

Some TEst Cases Fail Some pass during regression

SO I need input from everyone and also so I know if it's not just me. 

When I am running regression script during the regression I see a number of test cases failed or skipped steps in them and at the end of the regression in the results number of the test case are failed. whe I go ahead and run those manually or rerun those only test cases they pass what can I do to fix it.

Thanks

0 Likes
10 Replies
Highlighted
Knowledge Partner
Knowledge Partner

Re: Some TEst Cases Fail Some pass during regression

How are the failed test being run, CI/ALM/TestRunner?

Mark Smith.

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: Some TEst Cases Fail Some pass during regression

running all of the test cases from UFT

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: Some TEst Cases Fail Some pass during regression

Are you running them individually or in batches?

Is it failing on the same steps each time or random steps?

Mark Smith.

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: Some TEst Cases Fail Some pass during regression

it's rando, testcases which fail, i am running them off a excel sheet

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: Some TEst Cases Fail Some pass during regression

Also, I did separate the script into different chunks

Having multiple function libraries so it's not a big load on the main action.

if I share the framework layout can you help me optimize it?

 

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: Some TEst Cases Fail Some pass during regression

Yes sure.

Mark Smith.

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: Some TEst Cases Fail Some pass during regression

this is a sketch of my framework, can you please look into it and let me know how i can improve it? thanks

Also i was trying to see if i can right back the results to excel sheet in result column after the execution of the test cases. All the help is much appreciated thanks

datatable.AddSheet "dtTC"
datatable.AddSheet "dtTD"

datatable.ImportSheet "the excel sheet path","TestCase","dtTC"
datatable.ImportSheet "the excel sheet path","TestData","dtTD"

No_oftestcases = datatable.GetSheet("dtTC").GetRowCount
No_oftestSteps = datatable.GetSheet("dtTD").GetRowCount

For i = 1 To No_oftestcases
datatable.GetSheet ("dtTC").SetCurrentRow (i)
If datatable.Value("TestCaseRun","dtTC") = "Yes" Then
For j = 1 To No_oftestSteps
datatable.GetSheet ("dtTD").SetCurrentRow (j)

If datatable.Value("TestCaseID","dtTC") = datatable.Value("TestCaseID","dtTD") Then

callkeyword = datatable.Value("Keyword","dtTD")
para1 = datatable.Value("Argument1","dtTD")
para2 = datatable.Value("Argument2","dtTD")
para3 = datatable.Value("Argument3","dtTD")

Select Case callkeyword


Case Browser()

 Browser

End Select
End If

End If

Next
End If

Next
Function Browser()
systemutil.Run "chrome.exe","www.google.com"
End Function

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: Some TEst Cases Fail Some pass during regression

I can't see how this works, you have 2 If statements and 3 End If statements. You also have a Next statement in the wrong place.

Is this the full code?

Mark Smith.

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: Some TEst Cases Fail Some pass during regression

Sorry, I think it got posted messed up I am re-posting.


datatable.AddSheet "dtTC"
datatable.AddSheet "dtTD"

datatable.ImportSheet "the excel sheet","TestCase","dtTC"
datatable.ImportSheet "the excel sheet","TestData","dtTD"

No_oftestcases = datatable.GetSheet("dtTC").GetRowCount
No_oftestSteps = datatable.GetSheet("dtTD").GetRowCount

For i = 1 To No_oftestcases

datatable.GetSheet ("dtTC").SetCurrentRow (i)

If datatable.Value("TestCaseRun","dtTC") = "Yes" Then

For j = 1 To No_oftestSteps
datatable.GetSheet ("dtTD").SetCurrentRow (j)

If datatable.Value("TestCaseID","dtTC") = datatable.Value("TestCaseID","dtTD") Then

callkeyword = datatable.Value("Keyword","dtTD")
para1 = datatable.Value("Argument1","dtTD")
para2 = datatable.Value("Argument2","dtTD")
para3 = datatable.Value("Argument3","dtTD")

Select Case callkeyword

Case Browser()
Browser para1,para2

 

 


End Select
End If
Next
End If
Next

 

Function open_Browser(pname,pvalue)
systemUtil.Run pname,pvalue
End Function

 

it will pick up the value from the excel sheet from the columns as mentioned above.
I really appreciate your help and time

 

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: Some TEst Cases Fail Some pass during regression

I have a framework that someone asked me to review a few years ago. Do you want a copy to see what their approach was?

If you do PM me your email and I'll send you a copy

Mark Smith.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.