This is a migrated thread and some comments may be shown as answers.

Getting only failures in logs not all the details.

3 Answers 103 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dipali
Top achievements
Rank 1
Dipali asked on 16 Jul 2012, 09:15 AM

Hi Telerik Team,

I am facing issues with logging in case of coded steps with Telerik.  I have created a sample project to detailed the issue. In the attachment, I have a solution created using VS 2010 with Telerik plug-in. I have recorded a simple test. The test steps are:

  1. 1. GO to google.com.
  2. 2. Enter text  ‘telerik demo’ in search text box.
  3. 3. Click on search button.
  4. 4. Navigate to ‘hotmail.com’.
  5. 5. Enter text  ‘telerik demo’ in search text box.
  6. 6. Click on search button.

The above test will always fail on ste 5 due to not able to find search textbox as we are naviting to different url in step 4.

So this test I have recorded as” WebTest1”. I am calling this test in different ways.

Calling WebTest1 as test as step:

  1. As a recorded step:

 Test “CallRecorded Step” is calling “WebTest1”  as test as step. In this case I am getting the detailed logs, as I am progressiing with the test.

  1. As a coded step:
    1. Test “CallCoded Step” is calling “WebTest1”  as test as step in a coded way. Here in logs I am getting only the failure logs. I am not getting the step details in log as I get it in case of the prevoous scenario (option: a. As a recorded step).

My query is: why I am not able to get the step details in logs laong with the failure details? Am I missing anything here.

Could you guys please help me out to sort this logging issue with the structure I have mentioned. I need to use the above mentioned structure only as I need to have combination of recorded and coded steps. I cnnot have all the steps/tests as plain coded ones.

Thanks,

-Dipali.

3 Answers, 1 is accepted

Sort by
0
Prasad
Top achievements
Rank 1
answered on 16 Jul 2012, 12:26 PM
Hi Telerik 
              I am also getting the same scenario what Dipali has mentioned so will not described it so can you provide us help on it.

Regards

Prasad
0
Manish
Top achievements
Rank 1
answered on 18 Jul 2012, 07:14 AM
Hi Telerik Team,

I am also facing the same issue mentioned in this post with Visual Studio 2010 Telerik Plug-in. Can you provide the resolution for this issue?
0
Anthony
Telerik team
answered on 19 Jul 2012, 02:47 PM
Hello Dipali,

Thank you for the sample project.

The issue is with the line that writes the exception to the log. It seems it is interfering with the Test as Step logging. When I changed it to the following:

[CodedStep(@"Execute test 'WebTest1'")]
public void CallCodedStep_CodedStep1()
{
    try
    {
        this.ExecuteTest("WebTest1.tstest");
    }
    catch (Exception)
    {
    //  Log.WriteLine(LogType.Error, ex.ToString());
    }
 
}

...the log was correctly populated with the individual steps from the sub-test:

Overall Result: Fail
------------------------------------------------------------
'7/19/2012 9:43:59 AM' - Using .Net Runtime version: '4.0.30319.269' for tests execution.
'7/19/2012 9:43:59 AM' - Starting execution....
'7/19/2012 9:44:02 AM' - Detected custom code in test. Locating test assembly: LoggingIssue.dll.
'7/19/2012 9:44:02 AM' - Assembly Found: C:\Users\rinaldi\Desktop\LoggingIssue\LoggingIssue\bin\Debug\LoggingIssue.dll
'7/19/2012 9:44:02 AM' - Loading code class: 'LoggingIssue.CallCodedStep'.
------------------------------------------------------------
------------------------------------------------------------
'7/19/2012 9:44:02 AM' - Using 'InternetExplorer' version '9.0' as default browser.
'7/19/2012 9:44:19 AM' - 'Fail' : 1. [CallCodedStep_CodedStep1] : @"Execute test 'WebTest1'
 
>>> Test-as-Step 'WebTest1.tstest' log starts:
 
Overall Result: Fail
------------------------------------------------------------
'7/19/2012 9:44:04 AM' - Using 'InternetExplorer' version '9.0' as default browser.
'7/19/2012 9:44:05 AM' - 'Pass' : 1. Navigate to : 'http://www.google.com/'
'7/19/2012 9:44:06 AM' - 'Pass' : 2. Enter text 'telerik demo' in 'GbqfqText'
'7/19/2012 9:44:06 AM' - 'Pass' : 3. Click 'Span'
'7/19/2012 9:44:06 AM' - 'NotRun' : 4. Wait for '2000' msec.
'7/19/2012 9:44:08 AM' - 'Pass' : 5. Navigate to : 'https://accounts.google.com/'
'7/19/2012 9:44:08 AM' - 'NotRun' : 6. Wait for '2000' msec.
'7/19/2012 9:44:08 AM' - 'NotRun' : 7. Navigate to : 'http://www.google.com/'
'7/19/2012 9:44:19 AM' - 'Fail' : 8. Enter text 'english language' in 'GbqfqText'
------------------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
Unable to locate element. Details: Attempting to find [Html] element using
Find logic
 (Html): [id 'Exact' gbqfq] AND [tagname 'Exact' input]
 
Unable to locate element. Search failed!
 
------------------------------------------------------------
'7/19/2012 9:44:19 AM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
------------------------------------------------------------
'7/19/2012 9:44:19 AM' - Overall Result: Fail
'7/19/2012 9:44:19 AM' - Duration: [0 min: 15 sec: 288 msec]
------------------------------------------------------------
 
<<< Test-as-Step 'WebTest1.tstest' log ends.
 
------------------------------------------------------------
'7/19/2012 9:44:19 AM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
------------------------------------------------------------
'7/19/2012 9:44:19 AM' - Overall Result: Fail
'7/19/2012 9:44:19 AM' - Duration: [0 min: 17 sec: 689 msec]
------------------------------------------------------------
'7/19/2012 9:44:20 AM' - Test completed!


Greetings,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Dipali
Top achievements
Rank 1
Answers by
Prasad
Top achievements
Rank 1
Manish
Top achievements
Rank 1
Anthony
Telerik team
Share this question
or