I am writing automation scripts for Dynamics 365 using Selenium Webdriver with C#. All is good till I login and visit first page (a list). Test script clicks on one item in first page and page navigates to another page (ok) Now, when I try to read any field in next page I cannot. I found that
string pageSource = driver.PageSource; // returns source from previous page, string pageUrl = driver.Url; // returns correct/current url of the browser.
As mentioned in https://sqa.stackexchange.com/a/24979/34538 I have waited enough for the page to be loaded completely before accessing it.
To add: I tested by accessing an object in previous page which is not in current page. And I could read and click it.