Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding recording videos using browser library, I would like to be able to give name and should be able to have videos for failures #1747

Open
gvr-kumar opened this issue Feb 4, 2022 · 7 comments
Assignees
Labels
enhancement New feature or request priority: medium

Comments

@gvr-kumar
Copy link

gvr-kumar commented Feb 4, 2022

Is your feature request related to a problem? Please describe.

Yes. Its related to "video record" in "New Context".

Describe the solution you'd like

i) It would be great if I can give Name to video recording when using "video record" in the "New Context". Because for example, if I run 100 tests and if there are 100 recordings it's hard to know which recording is for which test.

ii) It would be great if I have capability to record videos for a) All tests b) Only Pass c) Only Fail when using "video record" in the "New Context".

Because having videos only for failures will be a great feature for Browser Library which will i) save the disk space. ii) will be easy to know where exactly the test is failing and reduces time to debug and identify the reason for failure.

Describe alternatives you've considered

I tried "ScreenCapLibrary" and didnot like it all. There are downsides to which are a) installing "ScreenCapLibrary" installs many other libraries. b) it does not record in head less mode.

Additional context

I like what Browser Library has for video record but with the above two features, it would be a huge advantage for Browser Library.
And thumbs up for ability to record videos in headless mode as well.

@aaltat
Copy link
Member

aaltat commented Feb 5, 2022

@allcontributors please add @gvr-kumar for ideas.

@allcontributors
Copy link
Contributor

@aaltat

I've put up a pull request to add @gvr-kumar! 🎉

@aaltat aaltat added enhancement New feature or request priority: medium labels Feb 5, 2022
@aaltat
Copy link
Member

aaltat commented Feb 5, 2022

What you request is difficult from many reasons.

  1. Creating videos is decided in context level, but each page has a separate video. Also name is decided by underlying Playwright.
  2. Video is created when a page is closed, but there is not easy way to determine in Browser library in which test this page belongs to and has there been a failure.
  3. We can detect when Browser library fail, but we do not see is that failure by purpose or is something that library should react on.

But because this is a real problem and it would be handy to be able to provide custom name for the video. Perhaps it would be possible to create custom name for the video, perhaps adding running number at the end of the file, so that it is not overwritten. Would that help in your problem?

@gvr-kumar
Copy link
Author

Hi Aaltat, sorry I am not able to follow. Could you please explain the below:

"But because this is a real problem and it would be handy to be able to provide custom name for the video. Perhaps it would be possible to create custom name for the video, perhaps adding running number at the end of the file, so that it is not overwritten. Would that help in your problem?"

As per my understanding, if at all I wanted to append the custom name and number to playwright generated naming where should I provide this custom name and number?

For example sample playwright generated video name : 03ac705268e997494448d2939f1f07ab.webm

@aaltat
Copy link
Member

aaltat commented Feb 14, 2022

Example it might be possible add test suite and test names as prefix for the filename. That would make finding the correct video more easily.

@gvr-kumar
Copy link
Author

gvr-kumar commented Feb 17, 2022

yes Aaltat, if you are saying that this (adding test suite name and testname as prefix for the filename) is possible and this feature will be available in the next browser library version then this is what I am looking for.

@Snooz82
Copy link
Member

Snooz82 commented Feb 4, 2023

@aaltat @gvr-kumar

The Videos are always belonging to the Page, even though it is activated in the context.

When a New Page keyword is called, it does return the page_id and the video_path.
So you could store/log that information directly at the beginning of the test case.

I think we also can easily improve that situation by logging the video path to the Open Page keyword and not just embedding the video.

New Page    http://car.keyword-driven.de
> {'page_id': 'page=f78f41a9-1199-4943-bcae-ff6bb8a5c4a1', 'video_path': '/System/Volumes/Data/Source/MarketSquare/robotframework-browser/browser/video/85ed4af9eed682d1300d24a0695febcc.webm'}

Also @aaltat i think we can check what is the active page, when an error appears and put that page on a "list" of videos to keep.
Therefore we can remove the video right away when a test is ending and there where no failure.

@Snooz82 Snooz82 modified the milestones: v16.0.0, v16.1.0 Feb 6, 2023
@aaltat aaltat modified the milestones: v16.0.4, v16.1.0 Apr 30, 2023
@aaltat aaltat modified the milestones: v16.1.0, v16.2.0 May 8, 2023
@aaltat aaltat modified the milestones: v16.2.0, v16.3.0 May 26, 2023
@aaltat aaltat modified the milestones: v16.3.0, v16.4.0 Jul 2, 2023
@Snooz82 Snooz82 added this to the v18.0.0 milestone Sep 17, 2023
@Snooz82 Snooz82 self-assigned this Sep 17, 2023
@aaltat aaltat modified the milestones: v17.5.2, v18.0.0 Oct 13, 2023
@aaltat aaltat modified the milestones: v18.0.0, v18.1.0 Oct 30, 2023
@Snooz82 Snooz82 removed this from the v18.0.0 milestone Nov 18, 2023
@Snooz82 Snooz82 added this to the Some Next Issues milestone Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: medium
Projects
None yet
Development

No branches or pull requests

3 participants