so my problem is this - I have a select (dropdown menu) with scrollbar and plenty of options, default position of scrollbar is around middle of the options (middle option is shown on select when it is not clicked), now in my test I need to click that select so options will be shown and then scroll to element with certain text value.
My code now looks like this:
WebUI.scrollToElement(findTestObject('SKLIK/page_vytvorit_kod/value_format', [('text') : varFormat]), 2)
WebUI.click(findTestObject('SKLIK/page_vytvorit_kod/hodnota_format', [('text') : varFormat]))
Step with scroll to element doesnt work and fails, and I dont know why, I checked if the correct value is set from variable to object property and this works, but somehow katalon cannot scroll up in the dropdown menu to the desired option.
Any ideas how to solve this? Any answers are higly appreciated in advance.
Select looks like this:
My goal is to select value which is not on the screen, it is visible when scrolled up a little bit
Yes, I tried this, but sadly it is not working since they have very special structure - see below
When I use attributes.zone_size_id as an object for selectByLabel, it doesnt locate element with text because that element is not directly under this select, but under “optgroup”
When I use clicking method with object from menu-transition-visible as stated above, it doesnt work too
Are you absolutely certain that is why it doesn’t work, or are you guessing that’s the reason?
Have you considered sending keys to trigger the scroll up?
What happens when you try select option by value? Is there any error?
Aside: It’s interesting that your post is the only post to ever mention optgroup – I don’t know if that’s a good sign since it might mean there isn’t an issue… or not
It is, indeed, my suggestion,
this is console log:
01-17-2019 04:23:30 odp. selectOptionByLabel(findTestObject(“Page_Vytvoit kd - Sklik/Dropdown2”), varFormat, false)
Elapsed time: 0,381s
Unable to select option by label '160×600 ’ of object ‘Object Repository/Page_Vytvoit kd - Sklik/Dropdown2’ (Root cause: org.openqa.selenium.NoSuchElementException: Cannot locate element with text: 160×600
// also I am locating object dropdown2 by this XPath: //*[@id=“attributes.zone_size_id”]
When I try to select option by value, console gives me this error - Unable to select option by value ‘7’ of object ‘Object Repository/Page_Vytvoit kd - Sklik/Dropdown2’ (Root cause: org.openqa.selenium.ElementNotVisibleException: element not interactable: Element is not currently visible and may not be manipulated
Possible solution: Make cases with all of the values given from test data, then based on cases scroll to element optgroup (horizontalni, vertikalni etc.) and then scroll and click element with desired value
I am gonna try this as soon as possible and bring outcomes
OK, so I found the origin of the problem and it was in the test data (ffs I am rtrded :D), I had a space after value in my excel sheet and therefore element couldnt be found…
Full marks for posting back, Marek. And don’t beat yourself up, we’ve ALL been there.
If you don’t learn humility being a coder or tester, you’ll never learn anything.
Thank you for your answers, though