Here is an xpath used to access scroll bar elements:
/html/body/div/div[3]/div/div[2]/div[2]/div[1]/table/tbody/tr/td/table/tbody/tr[5]/td/div/table[4]/tbody/tr/td/table/tbody/tr/td[3]/div/div/div/div[4]/div[1]/div[3]
I captured this xpath with Firepath, but it's lengthy and subject to change. I'm interested in accessing these elements using a css selector, however, I'm not sure how to do it. Below is part of the HTML file containing the scrollbar:
Question: How can I navigate to the Home, Previous, Next, End buttons starting from the 'class="z-biglistbox-one z-biglistbox" '? The previous xpath accessed the Next button. If you have any suggestions on how to achieve this, please share. Thank you.
<div id="pRCQhu3" class="z-biglistbox-one z-biglistbox" style="width:1100px;height:800px;">
<div class="z-biglistbox-outer">
<div id="pRCQhu3-head" class="z-biglistbox-head-outer">
<div id="pRCQhu3-body" class="z-biglistbox-body-outer" style="height: 653px;">
<a id="pRCQhu3-a" class="z-focus-a" style="top:0px;left:0px" onclick="return false;" href="javascript:;"></a>
<div id="pRCQhu3-vbar" class="z-biglistbox-wscroll-vertical">
<div id="pRCQhu3-hbar" class="z-biglistbox-wscroll-horizontal">
<div class="z-biglistbox-wscroll-drag" style="left: 0px;">
<div class="z-biglistbox-wscroll-home" title="Home"></div>
<div class="z-biglistbox-wscroll-up" title="Previous"></div>
<div class="z-biglistbox-wscroll-down" title="Next"></div>
<div class="z-biglistbox-wscroll-end" title="End"></div>
</div>
</div>
</div>
Note: There are multiple elements with the same class name. Using the class name directly accesses those elements instead of the desired ones. I'm considering using a similar approach to access the second occurrence of that class:
WebElement down = driver.findElement(By.className("z-biglistbox-wscroll-down[2]"));