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

Selenide mixes names of screenshots in case of parallel run #570

Closed
asolntsev opened this Issue Jul 6, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@asolntsev
Member

asolntsev commented Jul 6, 2017

... using @Rule Screenshooter (JUnit) or @Listeners{Screenshooter.class} (TestNG).

Problem description

Selenide stores name of current test in field ScreenShotLaboratory#currentContext, but the instance of ScreenShotLabaratory is hold in a singleton:

public class Screenshots {
  public static ScreenShotLaboratory screenshots = new ScreenShotLaboratory();

Effectively, it's broken when tests are executed in parallel threads.

@asolntsev asolntsev added this to the 4.6 milestone Jul 6, 2017

@jane-ryabchenko

This comment has been minimized.

Show comment
Hide comment
@jane-ryabchenko

jane-ryabchenko Sep 1, 2017

Contributor

Looks like I can solve this problem by changing ScreenShotLaboratory.currentContext and ScreenShotLaboratory.currentContextScreenshots to a ThreadLocal and ThreadLocal<List> correspondingly. Wdyt?

Contributor

jane-ryabchenko commented Sep 1, 2017

Looks like I can solve this problem by changing ScreenShotLaboratory.currentContext and ScreenShotLaboratory.currentContextScreenshots to a ThreadLocal and ThreadLocal<List> correspondingly. Wdyt?

jane-ryabchenko added a commit to jane-ryabchenko/selenide that referenced this issue Sep 1, 2017

jane-ryabchenko added a commit to jane-ryabchenko/selenide that referenced this issue Sep 6, 2017

jane-ryabchenko added a commit to jane-ryabchenko/selenide that referenced this issue Sep 6, 2017

jane-ryabchenko added a commit to jane-ryabchenko/selenide that referenced this issue Sep 6, 2017

jane-ryabchenko added a commit to jane-ryabchenko/selenide that referenced this issue Sep 6, 2017

jane-ryabchenko added a commit to jane-ryabchenko/selenide that referenced this issue Sep 12, 2017

@asolntsev asolntsev modified the milestones: 4.6, 4.7 Sep 18, 2017

@asolntsev asolntsev self-assigned this Sep 18, 2017

@asolntsev

This comment has been minimized.

Show comment
Hide comment
@asolntsev

asolntsev Sep 18, 2017

Member

Fixed in Selenide 4.7 with PR #595
@jane-ryabchenko thank you!

Member

asolntsev commented Sep 18, 2017

Fixed in Selenide 4.7 with PR #595
@jane-ryabchenko thank you!

@asolntsev asolntsev closed this Sep 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment