For same application if multiple browser screens are opened, I need a function to logoff from the application in perticular one instance. If any one come across this scenario let me know which fuction I can trust for smooth running.
Do you want to close any browser at random or is there any condition on which browser should be closed?
It would be a better practice to use delete cookies and close all the browsers at the beginning of the test and then open just one browser of the application.
If for some reason you cannot implement that then you can look for the title/creation time property of the browsers and close any one them.
Its automation not automagic