# Selenium | How to emulate mobile device

**URL:** <https://forum.knime.com/t/selenium-how-to-emulate-mobile-device/43465>\
**Category:** Community Extensions\
**Tags:** palladian-selenium\
**Created:** [May 25, 2022, 6:49am UTC](https://forum.knime.com/t/selenium-how-to-emulate-mobile-device/43465 "2022-05-25T06:49:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dashwoodhouse](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/c37758/32.png) [@dashwoodhouse](https://forum.knime.com/u/dashwoodhouse)\
**Post date:** [May 25, 2022, 6:49am UTC](https://forum.knime.com/t/selenium-how-to-emulate-mobile-device/43465/1 "2022-05-25T06:49:44Z")

</div>

Hello.

I was wondering if anyone can help me with setting up my Webdriver, so I can emulate a mobile device experience. I have been seeing how to do it through Selenium but not through the Selenium nodes in KNIME. Any guidance would be appreciated. Thank you so much!

---

<div class="post-metadata">

**Author:** ![qqilihq](https://forum-cdn.knime.com/user_avatar/forum.knime.com/qqilihq/32/50_2.png) [@qqilihq](https://forum.knime.com/u/qqilihq)\
**Post date:** [May 25, 2022, 9:35am UTC](https://forum.knime.com/t/selenium-how-to-emulate-mobile-device/43465/2 "2022-05-25T09:35:41Z")

</div>

Hi dashwoodhouse,

can you give some more details about what parts of a mobile experience would you want to address exactly and what your use case is?

Thanks,  
Philipp

---

<div class="post-metadata">

**Author:** ![dashwoodhouse](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/c37758/32.png) [@dashwoodhouse](https://forum.knime.com/u/dashwoodhouse)\
**Post date:** [May 26, 2022, 12:55am UTC](https://forum.knime.com/t/selenium-how-to-emulate-mobile-device/43465/3 "2022-05-26T00:55:53Z")

</div>

Hello, Philipp!

I would like to emulate viewing a website on mobile mode. I would like to see the website’s mobile mode appearance and screenshot it. Thank you!

---

<div class="post-metadata">

**Author:** ![qqilihq](https://forum-cdn.knime.com/user_avatar/forum.knime.com/qqilihq/32/50_2.png) [@qqilihq](https://forum.knime.com/u/qqilihq)\
**Post date:** [May 26, 2022, 1:19pm UTC](https://forum.knime.com/t/selenium-how-to-emulate-mobile-device/43465/4 "2022-05-26T13:19:24Z")

</div>

Understood, thanks for clarifying.

You can use Chrome/Chromium’s `mobileEmuation` property to specify details about the mobile device which you want to simulate. You will need to configure the capabilities structure in [Start WebDriver](https://nodepit.com/node/ws.palladian.nodes.selenium.start.StartWebDriverNodeFactory) or [WebDriver Factory](https://nodepit.com/node/ws.palladian.nodes.selenium.factory2.WebDriverFactory2NodeFactory) as follows (note to use the proper structure and types – sorry in advance, the capabilities editor is not very user friendly 😊 ):

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/c/9/c9d3b0adbc0218017a73b8013d2f0666c0ac0a31.jpeg)

The property names should be self-explanatory. You can typically google the specs for `width,` `height`, and `pixelRatio` if you search for like “iPhone mini screen size pixel ratio”. The `userAgent` depends on the browser and version which you’d like to simulate. Anyways, if you’ve been doing this with plain Selenium, this should be clear 🙂

I will include a ready-made example snippet for this in one of the next Selenium Nodes versions.

Hope this helps!

-Philipp

[update] Mini example workflow here on the Space: [Selenium\_Mobile\_43465 — NodePit](https://nodepit.com/workflow/com.nodepit.space/qqilihq/public/forum/Selenium_Mobile_43465.knwf)

---

<div class="post-metadata">

**Author:** ![dashwoodhouse](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/c37758/32.png) [@dashwoodhouse](https://forum.knime.com/u/dashwoodhouse)\
**Post date:** [May 26, 2022, 1:37pm UTC](https://forum.knime.com/t/selenium-how-to-emulate-mobile-device/43465/5 "2022-05-26T13:37:18Z")

</div>

Thank you so much, Philipp! This was exactly what I was looking for. I know that there was mobileEmulation and all these capabilities, but I couldn’t figure out how to put them in the Capabilities editor. Thank you again for all the help!

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 2, 2022, 1:37pm UTC](https://forum.knime.com/t/selenium-how-to-emulate-mobile-device/43465/6 "2022-06-02T13:37:36Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
