There is button which on clicking navigates to facebook login page and I want to confirm it navigates properly using selenium. However on button click the facebook login opens in a new tab but the driver.title returns the title of previous tab (where the button is present).
def test_01_facebook(self):
self.driver.find_element_by_xpath("//i[@class='fa fa-facebook-square']").click()
title = self.driver.title
self.assertTrue("Facebook" == self.driver.title)
print (title)
Alternatively I could compare the url using driver.current_url but the issue is the new tab url has a lengthy string after https://www.facebook.com/login.php?.
coded-ui-testsfor automated ui testing turns out it is a different tool like selenium used for UI testing. Thanks @AdrianHHH for the correction.