I tried set value on slider. I can connect to it. But then I try set value catch _ctypes.COMError: (-2146233079, None, (None, None, None, 0, None))
I tried this, but it not helps.
Asked
Active
Viewed 473 times
1

Denis_N
- 31
- 8
-
1can you give a full exaple of your code. – Juan Apr 20 '18 at 16:02
-
1[Here it is](https://pastebin.com/eFMd5ZSj) – Denis_N Apr 20 '18 at 16:36
-
Usually this error means that ValuePattern has incorrect implementation on app side. Which patterns are supported for this slider in Inspect.exe? – Vasily Ryabov Apr 20 '18 at 18:50
-
1@VasilyRyabov, [this is copyclipboard](https://pastebin.com/gA2Dfxnj) from Inspect.exe – Denis_N Apr 20 '18 at 20:51
-
Thanks! This is RangeValuePattern. Let me some time to provide a workaround when I’ll be near PC. – Vasily Ryabov Apr 21 '18 at 10:52
1 Answers
0
Hmm... This is interesting. We have working unit tests for standard WPF slider. See test_uiawrapper.py, line 780 for reference.
Everything looks the same in Inspect.exe also. But for WpfApplication1.exe it works.
[EDIT] Wait! You pass int number to set_value(...)
, how about float
or str
?
P.S. I can suggest a workaround since you should have "thumb" control as a child of the slider: slider.children(control_type="Thumb")[0]
. You can play with rectangles of the slider and the thumb (.rectangle().mid_point()
), then use click_input(coords=(x, y), absolute=False)
with relative coordinates calculated for specified value. Or even .drag_mouse_input(...)
is better, because one click should call just a small move in the direction of click.

Vasily Ryabov
- 9,386
- 6
- 25
- 78
-
yes, I tried to pass float and string to set_value(...). I had same results. "I can suggest a workaround since you should have "thumb" control as a child of the slider..." I thought about this decision, but I decided to wait for the answer. Looks like I'll have to do so. Thanks! – Denis_N Apr 22 '18 at 10:36