I am using playwright and Java. On test level I have
List<BrowserContext> browserContexts = browser.contexts();
browserContexts.get(1).close();
In debug mode I have two browsers context with a difference at the url name. Now I want to prepare a method which returns int for particular url which I need to used in this test. So this method I can put in
browserContexts.get(nameOfThisMethod).close();
Url name which I want to close has "/home" in name. I don't know how to write this method which will include steps to identify url which contains /home. Can someone help?