question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add selenium tests for Slider and RangeSlider

See original GitHub issue

Any chance to have that fixed or is there a workaround?

from bokeh.models import TextInput, RangeSlider
from bokeh.layouts import widgetbox
from bokeh.io import curdoc
from bokeh.client import push_session

def on_slider_change(attr, old, new):
    text.value = str(new[1])

def on_text_change(attr, old, new):
    try:
        n = int(new)
        n = max(n, -10)
        n = min(n, 10)

        slider.range = (0, n)

    except ValueError:
        return

text = TextInput(
        value=str(2),
        title='Population Beta:')
text.on_change('value', on_text_change)

slider = RangeSlider(
        start=0,
        end=10,
        range=(0, 2),
        step=1,
        title='Population Beta')

slider.on_change('range', on_slider_change)

curdoc().add_root(widgetbox(text, slider))

#session = push_session(curdoc())
#session.show(widgetbox(text, slider)) # open the document in a browser
#session.loop_until_closed() # run forever

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
bryevdvcommented, Jun 30, 2017

@zoohair this code seems to work as expected for me on master (or 0.12.7dev10)

from bokeh.models import TextInput, RangeSlider
from bokeh.layouts import widgetbox
from bokeh.io import curdoc
from bokeh.client import push_session

def on_slider_change(attr, old, new):
    text.value = str(new[1])

def on_text_change(attr, old, new):
    try:
        n = int(new)
        n = max(n, -10)
        n = min(n, 10)

        slider.value = (slider.value[0], n)

    except ValueError:
        return

text = TextInput(
        value=str(2),
        title='Population Beta:')
text.on_change('value', on_text_change)

slider = RangeSlider(
        start=0,
        end=10,
        value=(0, 2),
        step=1,
        title='Population Beta')

slider.on_change('value', on_slider_change)

curdoc().add_root(widgetbox(text, slider))

@mattpap it looks like the new slider has value instead of range? I’m OK with that but we need a migration note

I also still think it is a missing feature to not easily be able to update one or other of the values without updating both.

0reactions
bryevdvcommented, Apr 13, 2019

OK the original issue was resolved (I just checked again with 1.1.1dev1) but we should add an integration test now that is is easier to do

Read more comments on GitHub >

github_iconTop Results From Across the Web

selenium-webdriver - how to automate Range sliders - Intellipaat
I want to automate the Range Slider based on the given parameter values. I just tried with Actions class but facing the problem...
Read more >
Selenium: how to automate Range sliders - Stack Overflow
as @Murthi suggested i can automate http://rangeslider.js.org/ by changing the value of input field, using the below code. var ele = $('input[ ...
Read more >
How to interact with sliders in Selenium WebDriver
Move Slider's Handle To End. The first test does the following. open the site. find the slider element and assert that it is...
Read more >
[Code example]-Selenium: how to automate Range sliders
Code what i have tested. void automateApplication( RemoteWebDriver driver ) { driver.get( "http://rangeslider.js.org/" ); driver.manage().window().maximize(); ...
Read more >
How to move the slider at specific position in Selenium
I see there's already a good answer for this but I'd just like to add my explicit solution in case it helps anyone....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found