# Handling Hidden Element

**URL:** <https://forum.robotframework.org/t/handling-hidden-element/8208>\
**Category:** Robot Framework\
**Created:** [24 December 2024 17:53 UTC](https://forum.robotframework.org/t/handling-hidden-element/8208 "2024-12-24T17:53:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mtest6835](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Mtest6835](https://forum.robotframework.org/u/Mtest6835)\
**Post date:** [24 December 2024 17:53 UTC](https://forum.robotframework.org/t/handling-hidden-element/8208/1 "2024-12-24T17:53:43Z")

</div>

//input[@name=‘username’]

While Entering Data into an input box; Getting Below Error:  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m  
[2m - locator resolved to hidden [22m

How to deal here? I am using Browser library.  
@falcon030 @damies13 @René

---

<div class="post-metadata">

**Author:** ![falcon030](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/falcon030/32/3420_2.png) [@falcon030](https://forum.robotframework.org/u/falcon030)\
**Post date:** [24 December 2024 20:44 UTC](https://forum.robotframework.org/t/handling-hidden-element/8208/2 "2024-12-24T20:44:13Z")

</div>

Can you share the HTML of the page and mark the element with which you are trying to interact?

---

<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:** [24 December 2024 23:54 UTC](https://forum.robotframework.org/t/handling-hidden-element/8208/3 "2024-12-24T23:54:52Z")

</div>

Hi Pankaj,

is this on the login screen or a create user screen?

Often the cause of things like this is when the form dynamically display’s / hides fields based on previous input in the form (obviously this doesn’t really apply to a login screen)

Put in a temporary take screenshot step before and see if the field you want is actually on the screen?

If this is a login screen has the page loaded? do you need a wait step to wait for it?

As @falcon030 mentioned seeing the html will help, also for future reference mention the library you’re using so we can suggest the right keywords, is this Browser Library?

Dave.

---

<div class="post-metadata">

**Author:** ![Mtest6835](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Mtest6835](https://forum.robotframework.org/u/Mtest6835)\
**Post date:** [25 December 2024 04:12 UTC](https://forum.robotframework.org/t/handling-hidden-element/8208/4 "2024-12-25T04:12:20Z")

</div>

@falcon030 @damies13 Please find attached. I am using Browser Library.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/b/b7568726098922e8ea5b3cef9aaa59bb8f118884.png)

#Browser-Dev#Browser

---

<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:** [25 December 2024 08:30 UTC](https://forum.robotframework.org/t/handling-hidden-element/8208/5 "2024-12-25T08:30:32Z")

</div>

Hi Pankaj,

There is another field with the ID: sso-email, that has the label “Email or Emerates SkyRewards Number”, is this the field you want?

If you do want the `username` and not `sso-email`, I see that the username field is hidden, and that’s why browser library can’t interact with it, the element is not showing in the browser.  
Is there a radio button or checkbox or similar that switches the login screen between “login with username” and login with “email or SkyRewards number”?

- You might need to find the item you need to interact with to make the `username` field not hidden?
- Or maybe when you fill in `sso-email`, the javascript on the page might update the `username` field with the validated value from `sso-email`? (I’ve seen apps that do this too)

Hope that helps,

Dave.

---

<div class="post-metadata">

**Author:** ![falcon030](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/falcon030/32/3420_2.png) [@falcon030](https://forum.robotframework.org/u/falcon030)\
**Post date:** [26 December 2024 22:42 UTC](https://forum.robotframework.org/t/handling-hidden-element/8208/6 "2024-12-26T22:42:28Z")

</div>

@Mtest6835 Since Browser Library is based on Playwright I suggest to use [Playwright Codegen](https://playwright.dev/docs/codegen-intro#running-codegen). With this tool you can record a test and also generate locators. You can then convert the test / locators to Browser Library equivalents. Installing Playwright is quite simple [Installation | Playwright](https://playwright.dev/docs/intro#installing-playwright)

---

<div class="post-metadata">

**Author:** ![\_daryl](https://avatars.discourse-cdn.com/v4/letter/_/45deac/32.png) [@\_daryl](https://forum.robotframework.org/u/_daryl)\
**Post date:** [27 December 2024 12:21 UTC](https://forum.robotframework.org/t/handling-hidden-element/8208/7 "2024-12-27T12:21:09Z")

</div>

@Mtest6835

Further up in the tree it’s showing that field is for mobile, so I’d imagine if you search for the element it would bring back more that one result. Feels/sounds like you need to be a little more specific so your hitting the right one for the view your testing against.
