Service Virtualization

  • 1.  Selenium Step for screenshot

    Posted Dec 05, 2016 02:38 PM

    Hi

    I have Integrated screen shot step in my test script using selenium step.

          {
            "type": "saveScreenshot",
            "file": "/tmp/x.png"
        },

    This above step can only take one screen shot and I want to take multiple screenshots executing multiple times.

     

    I am seeing the existing "x.png" is replaced but I want to create one screenshot when executed.

     

    please help me understand how can I increment the same step to capture a different screen.

     

    Thanks



  • 2.  Re: Selenium Step for screenshot

    Broadcom Employee
    Posted Dec 09, 2016 03:57 PM

    Yeshwant,  If n = number of times you want to execute the step

     

    Add an assertion in your step to check for  n times and   loop the step to itself  to execute n times. 

    save file as   "file": "/tmp/x(n).png"

     

    If you still have questions, please open a ticket with CA Support. 



  • 3.  Re: Selenium Step for screenshot
    Best Answer

    Broadcom Employee
    Posted Dec 11, 2016 09:55 PM

    Yashwant,

         You can use datasheet, which will create a property Count and use this property in Selenum step as below and keep in loop to capture multiple times (10 times).

    {
            "type": "saveScreenshot",
            "file": "/tmp/x{{Count}}.png"
        },