# Migrate from selenium to browser library

**URL:** <https://forum.robotframework.org/t/migrate-from-selenium-to-browser-library/1013>\
**Category:** Browser\
**Created:** [25 November 2020 08:49 UTC](https://forum.robotframework.org/t/migrate-from-selenium-to-browser-library/1013 "2020-11-25T08:49:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikitech83](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/vikitech83/32/666_2.png) [@vikitech83](https://forum.robotframework.org/u/vikitech83)\
**Post date:** [25 November 2020 08:49 UTC](https://forum.robotframework.org/t/migrate-from-selenium-to-browser-library/1013/1 "2020-11-25T08:49:06Z")

</div>

Any recommendations for migration of existing custom keywords based on selenium2library to browser library

---

<div class="post-metadata">

**Author:** ![aaltat](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/aaltat/32/15_2.png) [@aaltat](https://forum.robotframework.org/u/aaltat)\
**Post date:** [29 November 2020 19:44 UTC](https://forum.robotframework.org/t/migrate-from-selenium-to-browser-library/1013/2 "2020-11-29T19:44:05Z")

</div>

Have you seen [https://www.valagroup.com/2020/11/robot-framework-browser-library/](https://www.valagroup.com/2020/11/robot-framework-browser-library/)

---

<div class="post-metadata">

**Author:** ![adrian-evo](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/adrian-evo/32/514_2.png) [@adrian-evo](https://forum.robotframework.org/u/adrian-evo)\
**Post date:** [1 December 2020 06:27 UTC](https://forum.robotframework.org/t/migrate-from-selenium-to-browser-library/1013/3 "2020-12-01T06:27:28Z")

</div>

Nice and useful article. Thanks.

I am also migrating my project and I started first with some custom temporary keywords that would translate selenium keywords to browser keywords with one line of code, e.g. all “wait until element is…”, or “wait until page…” or “page should…” are translated to “wait for elements state”, while replacing only state, e.g.:

Wait Until Element Is Visible  
[Arguments] {element} {timeout}=None  
wait for elements state {element} state=visible timeout={timeout}

For click, select, input text keywords I had custom keywords anyway that would encapsulate also wait so now it is easier to migrate.

This is the first step, so that to make sure the new Browser library is working, which it did, and it is much faster. Obviously the next step, after everything is proved to work, is to replace all these temporary keywords with corresponding Browser keywords, so that the code would look cleaner and simpler.

---

<div class="post-metadata">

**Author:** ![Sebplais](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@Sebplais](https://forum.robotframework.org/u/Sebplais)\
**Post date:** [2 June 2021 14:30 UTC](https://forum.robotframework.org/t/migrate-from-selenium-to-browser-library/1013/4 "2021-06-02T14:30:24Z")

</div>

One good advice also is to understand that all browser lib keyword already natively integrate the wait for element state, This mean that you do not need anymore to add them before doing an action on a element .  
If you need to click on a button, Click “ButtonElement” will natively wait that ButtonElement is enabled, visible …  
This will clean a lot your test code as for Selenium you needed to add this “wait for” everywhere

---

<div class="post-metadata">

**Author:** ![LeTiina](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/letiina/32/1891_2.png) [@LeTiina](https://forum.robotframework.org/u/LeTiina)\
**Post date:** [30 September 2022 10:21 UTC](https://forum.robotframework.org/t/migrate-from-selenium-to-browser-library/1013/5 "2022-09-30T10:21:29Z")

</div>

I just run into a problem where element was not found with (test fail)  
Click ${xbutton} delay=100ms  
but found and test run succesfully with  
Click ${xbutton} delay=1000ms

Not sure why Browser did not wait for the element, but anyways solved with adding delay time!
