Added opitonal switchToWindow switch for createChatPageObject and used
it accordingly;