Scroll into view option select issues.

34 views
Skip to first unread message

Jonn Doe

unread,
May 13, 2024, 8:28:57 AMMay 13
to Selenium Users

Don't know the rules, so forgive me if I break them.

The website: allnovelbook.com

Select any book, go to a chapter page. There's a seletc at the top for selecting
chapters.

Need to click on it, then select a chapter.

In selenium no matter what I do I keep getting cannot scroll into view, even when my screen res is at max.

I have tried going to the option via a js click, by move to action and click, by select by index, select by value, I have literally tried everything. Even when the option is the second or 3rd one.

Any idea what could cause this weirdness?

Jonn Doe

unread,
May 14, 2024, 4:58:23 PMMay 14
to Selenium Users

ANy one can help? I find the element but cannot click on it, select it or JS click. It's shown on screen, but the weird thing is the location is set as 0,0 for xy. Anyone have any ideas please!!!!

Sir Jo

unread,
May 17, 2024, 7:53:44 AMMay 17
to Selenium Users
This code work for me:
(it tell me that there are 853 chapters)

        driver.Navigate.GoToUrl("https://allnovelbook.com/novel/fantasy-simulator/chapter-1")
        Sjs.Sleep(6000) ' wait for load complete

        Dim el = driver.FindElement(By.Name("chapter_id"))
        driver.ExecuteScript("arguments[0].dispatchEvent(new MouseEvent('click',{view:window,bubbles:true,cancelable:true,buttons:1}));", el)
        Sjs.Sleep(3000) ' wait for load complete
        Dim els = el.FindElements(By.TagName("option"))
        Me.Activate()
        MsgBox("There are " & els.Count.ToString & " chapters")
Reply all
Reply to author
Forward
0 new messages