raj85
01-20-2015, 03:08 AM
Hi Friends,
I am workin on an automation where I have to provide input to a webpage in which a different control I saw which name is range input below is the html code for same.
ONce user change range by dragging mouse one chart get updated.
<div class="range">
<label for="score">scores</label>
<div class="labels">
<span>600</span>
<span class="max">850</span>
</div>
<input style="width: 1px; height: 1px; overflow: hidden; position: absolute; opacity: 0;" id="credit-score" value="700" type="range" step="20" max="840" min="600">
<div id="js-rangeslider-1421669192041" class="rangeslider">
<div style="width: 243.5px;" class="rangeslider__fill"></div>
<div style="left: 232.5px;" class="rangeslider__handle"></div></div>
<div style="left: 223.49px;" id="slider-range" class="range-text">800 - 819
</div>
</div>
I am able to get control of this but some how even after assigning new value it not working and chart is not getting updated :banghead: I am using below code for same.
Set oTab1 = IE.Document.GetElementById("score")
Set oTab = IE.Document.GetElementById("js-rangeslider-1421669192041")
For Each oLink In oTab.all
If InStr(1, oLink.outerhtml, "rangeslider__fill", vbTextCompare) Then
oLink.Style.Width = "150.5px"
ElseIf InStr(1, oLink.outerhtml, "rangeslider__handle", vbTextCompare) Then
oLink.Style.left ="139.5px"
End If
Next
'
IE.Document.GetElementById("slider-range").Style.left = "130.5px"
IE.Document.GetElementById("slider-range").innertext = "720-739"
IE.Document.GetElementById("slider-range").fireevent ("oninput")
oTab1.Value = 720
Please suggest me how I can provide input to range type control.
I am workin on an automation where I have to provide input to a webpage in which a different control I saw which name is range input below is the html code for same.
ONce user change range by dragging mouse one chart get updated.
<div class="range">
<label for="score">scores</label>
<div class="labels">
<span>600</span>
<span class="max">850</span>
</div>
<input style="width: 1px; height: 1px; overflow: hidden; position: absolute; opacity: 0;" id="credit-score" value="700" type="range" step="20" max="840" min="600">
<div id="js-rangeslider-1421669192041" class="rangeslider">
<div style="width: 243.5px;" class="rangeslider__fill"></div>
<div style="left: 232.5px;" class="rangeslider__handle"></div></div>
<div style="left: 223.49px;" id="slider-range" class="range-text">800 - 819
</div>
</div>
I am able to get control of this but some how even after assigning new value it not working and chart is not getting updated :banghead: I am using below code for same.
Set oTab1 = IE.Document.GetElementById("score")
Set oTab = IE.Document.GetElementById("js-rangeslider-1421669192041")
For Each oLink In oTab.all
If InStr(1, oLink.outerhtml, "rangeslider__fill", vbTextCompare) Then
oLink.Style.Width = "150.5px"
ElseIf InStr(1, oLink.outerhtml, "rangeslider__handle", vbTextCompare) Then
oLink.Style.left ="139.5px"
End If
Next
'
IE.Document.GetElementById("slider-range").Style.left = "130.5px"
IE.Document.GetElementById("slider-range").innertext = "720-739"
IE.Document.GetElementById("slider-range").fireevent ("oninput")
oTab1.Value = 720
Please suggest me how I can provide input to range type control.