Capture Browser from Test Studio

4 posts, 0 answers
  1. Tory
    Tory avatar
    6 posts
    Member since:
    Sep 2012

    Posted 27 Mar 2013 Link to this post

    I read in some other thread that the Capture Browser step could only take screenshots if launched from Test View in Visual Studio. 

    Is there any way to get the sceenshots to work from Test Studio? I'm exploring this product as a potential addition to the software our QA team uses. I'd prefer if they didn't have to use Visual Studio for this feature to work.
  2. Michael
    Michael avatar
    5 posts
    Member since:
    Mar 2013

    Posted 27 Mar 2013 Link to this post

    I was able to do this in Test Studio using a Coded Step - from the 'Add' menu in a test pick 'Script Step', and replace the code with something like this (VB.net version):

    <CodedStep("New Coded Step")> _
            Public Sub WebTest_CodedStep()
                Dim FileName = "Capture"
                Log.CaptureBrowser(ActiveBrowser, "C:\Logs\" + FileName)
            End Sub

    For the screenshot to actually save to disk, I believe this has to be run from a test list.

    [edit]
    Better yet - on the 'Add' menu, if you click 'More', Browser Capture is one of the options.
  3. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 29 Mar 2013 Link to this post

    Hello Tory,

    The problem you are thinking about is that when you Quick Execute a test, we deliberately disable the Capture Browser and Capture Desktop commands, this includes the those in code that Michael references. This behavior is exactly the same in both standalone Test Studio and our Visual Studio plug-in. The reasoning behind this is Quick Execution is intended only for test development. During test development you're not supposed to need Capture Browser/Desktop, at least in theory.

    If you run your test via any other method e.g. command line, test list, scheduling server, VS test view, VS Test List Editor the captures will happen.

    I hope this clarifies what is supposed to happen with our Capture feature.

    Greetings,
    Cody
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  4. Tory
    Tory avatar
    6 posts
    Member since:
    Sep 2012

    Posted 01 Apr 2013 Link to this post

    That makes a lot of sense. Thank you very much for your response and for clearing that up. 
Back to Top