try using this approach for working with new tabs:
with context.expect_page() as new_tab: self.accountSetup_link.click() tab = new_tab.value acc_setup = AccountSetup(tab, context)