# Get page title(s) with Browser Library

**URL:** https://forum.robotframework.org/t/get-page-title-s-with-browser-library/5785
**Category:** Robot Framework
**Created:** [5 June 2023 14:35 UTC](https://forum.robotframework.org/t/get-page-title-s-with-browser-library/5785 "2023-06-05T14:35:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![LaurensRobot](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/laurensrobot/32/2037_2.png) [@LaurensRobot](https://forum.robotframework.org/u/LaurensRobot)
#### Post date: [5 June 2023 14:35 UTC](https://forum.robotframework.org/t/get-page-title-s-with-browser-library/5785/1 "2023-06-05T14:35:14Z")

</div>

Hi,

Im struggling with translating all my Selenium library based scripts to Browser library.  
The recent subject is that I’m trying to get the titles of the pages I have opened in order to run an assertion.

‘@{Titles} = Browser.  
Should Be Equal As Strings ${Titles[1]} Expected Title of Page’

Does anyone know how I can store the multiple title pages in an array and use indexing to confirm the title names are as expected?

Thank you in advance!

---

<div class="post-metadata">

### Author: ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)
#### Post date: [6 June 2023 01:53 UTC](https://forum.robotframework.org/t/get-page-title-s-with-browser-library/5785/2 "2023-06-06T01:53:28Z")

</div>

Hi Laurens,

it looks like Browser Library doesn’t have a keyword that gives you a list title’s directly.

You could however easily create one, it would probably look something like this:

```plaintext
Get Titles
    # create a blank list
    @{TitleList}= Create List
    @{PageIDs}= Get Page Ids
    FOR ${pageid} IN @{PageIDs}
        Switch Page ${pageid}
        ${PageTitle}= Get Title
        Append To List ${TitleList} ${PageTitle}
    END
    RETURN ${TitleList}

```

`Append To List` comes from [Collections Library](https://robotframework.org/robotframework/latest/libraries/Collections.html) so don’t forget to include that.

But if you just want to check the one page title you can simply just do:

```python
    @{PageIDs}= Get Page Ids
    Switch Page ${pageid[1]}
    ${PageTitle}= Get Title
    Should Be Equal As Strings ${PageTitle} Expected Title of Page’

```

Dave.
