This topic is locked
[SOLVED]

Hide usename_button

2/10/2025 6:58:41 AM
PHPRunner General questions
G
GuilleSaa author

PHPRunner V11 - 42987
After logging I need to hide the username_button or at least its options.
I have tried several ways but without success.
I can't find the correct code.

Thanks in advance

D
Denes 2/10/2025

Hello GuilleSaa!

What kind of solution have you try?
Have you try a debug process?

G
George Kondylis 2/10/2025

Hello GuilleSaa,

I assume that you are referring to the user profile menu on the top righ corner.

You can try the below on the Before display event.
$pageObject->hideItem("username_button");

I am using the default button name. If you go the list page designer and click on the button, you 'll see on the right menu the exact button name on your project (look for item id). Also, if you click on the ? icon next to it , you ' find quite detailed instructions of how to use the code above.

The only problem is that you need to repeat the process for every page. Not sure if there is a shorte way to hide from all pages

George

G
GuilleSaa author 2/10/2025

I tried what George said, but it still shows the button.
I also used the "JavaScript OnLoad event" with $("#username_button").hide(); but no success.
Guillermo

C
copper21 2/10/2025

The checkmark next to the item id will assist you.

Click on the username item, then look to the right menu area and you should see "item id". Your item id should be something like "username_button". Next to that click the question mark.

To hide this, you will probably use the code:

$pageObject->hideItem("username_button");

Put this code in the "Before Display" event of the list page or whatever page you are trying to hide it in.

If you want to keep the username shown, but make the options hide after you click the username, click the "(2)" in the button. You will see the two options appear. Click on the option that you want to hide follow the instructions above.

G
George Kondylis 2/10/2025

Guillermo,

Just noticed that you are testing on V11. I am still using v10 .I am not sure if there is an issue with that.

G
GuilleSaa author 2/10/2025

George
Following on a comment of yours, ... "The only problem is that you need to repeat the process for every page" , this is the issue.
I was applying the code on the login page instead of the Welcome page.

I'm adding $pageObject->hideItem("username_button") on all the list pages, but as you say, I don't know if there is something global.
Thank you very much for your help

Guillermo