Change display element from "None" to "Block"

q

WebUI.executeJavaScript("document.getElementById('db').removeAttribute('style')",null)WebUI.executeJavaScript("document.getElementById('db').setAttribute('style','width: 100%; display: block;')", element)

this should do it (i hope)

1 Like

Andrej Podhajský said:

WebUI.executeJavaScript("document.getElementById('db').removeAttribute('style')",null)WebUI.executeJavaScript("document.getElementById('db').setAttribute('style','width: 100%; display: block;')", element)

this should do it (i hope)

Hi There,

After much Trial and error I have found the correct way of getting this to work. see below. Thanks again as I used your response as a means to resolve the issue at hand.

WebUI.executeJavaScript(‘document.getElementById(\‘db\’).setAttribute(\‘style\’,\‘display:block\’)’, null)

Now If I can just get Katalon to Hide a Div Class I do not want showing up, I’d be all set. Thanks again!

just use example above and in setAttribure use display: none;

Andrej Podhajský said:

just use example above and in setAttribure use display: none;

Hi Andrej,
Sadly the same line cannot be provided for the Div class as their is no Element ID specified for the Div in question. Below is what the Div looks like that I am trying to hide.


<div class="fastcombo ignore" style="width: 100%;

if you share more HTML, we can try to help you construct good xpath to use in code

Hello I’m facing the same issue. I try to set a value to a text field, but by default the div has status display: none.
Can you help me how to construct the JS call. Here is the HTML (the field I want is highlighted).

WebUI.executeJavaScript(‘document.getElementById(\‘gwt-debug-dashboard-filterpanel-textbox-onefdr\’).setAttribute(\‘style\’,\‘display:block\’)’, null)