Unable to Click and select the option from dropdown textbox

Hi

I have a Dropdown textbox on my application page. On click of textbox it shows dropdown list. But When i run the script it doesn’t work. I am not able to click on textbox and select a option from dropdown.

Dropdown Text box looks like this
111
112

My script is here

WebUI.verifyElementVisible(findTestObject(‘Address zone/List’), FailureHandling.CONTINUE_ON_FAILURE)

CustomKeywords.‘clickaction.Click.clickUsingJS’(findTestObject(‘Address zone/List’),
0)

WebUI.verifyElementVisible(findTestObject(‘Address zone/li_L1’), FailureHandling.CONTINUE_ON_FAILURE)

WebUI.click(findTestObject(’ Address zone/li_L1’))

HTML of element is below

Any help?

Thank you

Are you attempting to click on the + symbol to open the drop down or are you clicking on the actual text box to open the drop down?

Why? Is there an error? What does it say?

Clicking on actual Text not the + symbol.

I am getting this error “Object ‘Object Repository/Address zone/li_L1’ is NOT visible”

This line happens first…

This line comes next, but happens too quickly after the line above

You’ll notice in your HTML screenshot, the UL element is empty. This suggests the LI elements have not been populated yet.

Try waitForElementVisible

https://docs.katalon.com/katalon-studio/docs/webui-wait-for-element-visible.html

1 Like

Hi i tried using waitForElementVisible But not worked, still it says Element not visible. Infact I do not see the dropdown list when test is running. But Click action says test passed in log view.

WebUI.verifyElementVisible(findTestObject(‘Address zone/List’), FailureHandling.CONTINUE_ON_FAILURE)

CustomKeywords.‘clickaction.Click.clickUsingJS’(findTestObject(’ Address zone/List’),
0)

WebUI.waitForElementVisible(findTestObject(‘Address zone/li_L1’), 4)

WebUI.click(findTestObject(’ Address zone/li_L1’))

This is the Error

Unable to click on object ‘Object Repository/Address zone/li_L1’ (Root cause: org.openqa.selenium.ElementNotVisibleException: element not visible
(Session info: chrome=72.0.3626.121)
(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 10.0.17763 x86_64) (WARNING: The server did not provide any stacktrace information)

Ok so if you dont see the drop down then its clearly something wrong with this step as its not performing the click

Instead of using your custome keyword just try WebUI.click, if this doesnt work then try clicking on the + symbol instead to option the drop down.

Hang on Harry… I need to remind creta of something

We can’t debug fake code!!!

Is that a copy/paste? I think not. Just for posterity, here’s a picture of it, too:

image

And here’s another one:

image

PLEASE PLEASE PLEASE fix your code properly, or, stop retyping and use COPY/PASTE.

1 Like

HI hpulsford.

This keyword is working fine with other elements. Do not know whats wrong with this specific step!!
“CustomKeywords.‘clickaction.Click.clickUsingJS’(findTestObject(’ Address zone/List’),
0)”

And + symbol is to add the UDF field’s and that ll show up in dropdown. We can only add the dropdown options there and we cannot select the option from there. It looks something like this

I tried the WebUi.Click, but still it’s not working for me:(

Hi Russ,

I undestand and i am sorry for that. There are something which is confidential and i cannot share here :frowning: That’s the reason i had removed the actual path from object repository. Cause term used is very confidential. That is making me to retype n modify the scripts.

1 Like

But you understand it makes it very difficult for us

Have I found a problem ONLY in your code here?

Is there a real problem in your code which is NOT posted here?

When I see a typo here, how do I know if it’s in your actual code? Please take great care to reflect your real code as best you can. Thank you.

2 Likes

Sure Russ!!

Thank you for understanding :slight_smile:

In that case - its obviously having trouble actually locating the element itself to click on - Can you please share the elements attributes you captured ? or did you manually add the xpath

1 Like

If this line passes…

And this line fails immediately after with ElementNotVisibleException

There’s something very strange going on.

Aside: There doesn’t appear to be anything wrong with your custom keyword <== red herring.

Here is the captured object. Not entered any xpath manually

111

Can you click on attributes and take a screenshot of that aswell please

Mean Inspect element?

No - on the screenshot you just sent me, next xpath click on attributes - please make sure that you make the window big enough so that none of the text is cut off

Here it is