Quality is delighting customers
For collecting header title..you basically need a common html element which is being used by the same webelements
Then you need to insert those in a List<WebElement> and then you can iterate it and use it accordingly.
As you are saying that there is no common XPath being used...you have to look for alternatives for finding the WebElements..for e.g css
selectors can be of great use
Also for capturing the titles of the report u have to click the view button capture the report title and store it in some static string value..then close it
and then go ahead and click on the 2nd view..and go ahead so on
You are also saying that the heading format is aligned either right or left..for me its a defect which
has to be first fixed by the dev and then only you can fetch the title
otherwise you will need to open every other report and then hard-code the locators(as they are changing) in your code.
I have tried this to capture the header
Refer for test automation services for any further automation related queries.