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

Set a list to Session variable and use #3205

Closed
maidinhh opened this issue Aug 1, 2023 · 3 comments
Closed

Set a list to Session variable and use #3205

maidinhh opened this issue Aug 1, 2023 · 3 comments
Labels

Comments

@maidinhh
Copy link

maidinhh commented Aug 1, 2023

Hi everyone, I am new in Serenity!
I have a list String called A and I set it to session like this:
List listAtr = helper.findElements(locator);
Serenity.setSessionVariable("data").to(listAtr);
Then how to get list A and compare with new list called B
(Please give me example)
Thank you so much!

@maidinhh
Copy link
Author

maidinhh commented Aug 6, 2023

@wakaleo please help me on this question if you know! thank you so much!

@Rangiferus
Copy link

@maidinhh This is not the question related to Serenity itself but rather to Java. I understand that you want to compare lists of objects. Why don't you simply search for "finding the differences between two lists in Java"?

tip: When you retrieve the list from your session variable you simply call (List<XXX>) Serenity.sessionVariableCalled("data")

@maidinhh
Copy link
Author

Thank for your support! Now I can handle this problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants