Is there a way to establish a default class name with Selenium WebDriver when dealing with two panels that share the same class name

The task at hand involves scrolling through panels in my system, where two panels exist with scrollbars that share the same Class name. I am using Selenium Webdriver and need assistance on how to specifically scroll down the second panel.

Scrollbar Class Name : mCSB_draggerRail

I have attempted the following code to achieve this:

driver.findElement(By.className("mCSB_draggerRail")).click();

However, upon running the code, it scrolls the first panel instead of the desired second panel. How can I adjust the code to scroll Panel 2 instead?

Answer №1

To achieve this in Java, here are the straightforward steps:

Step 1: Locate and click on the main scroll element using its xPath.

Step 2: Similarly, find and click on the scrollbar element based on its xPath.

Step 3: Execute the script to perform the desired action.

Please take note that the main scroll acts as a button that triggers scrolling within the scrollbar.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Attempting to extract a particular string from a separate class following the deserialization of JSON data

I'm completely new to C# and I'm attempting to create a web service where users can enter latitude and longitude coordinates and receive the corresponding 'google type' in return. My goal is to extract the 'type[]' from the &a ...

Scraping with Selenium Spans

When using selenium to scrape data within a span element, my code retrieves the entire content of the span item, such as "280 [-49]". How can I clear the extra text inside the span and only get the value 280? warrant_bar = driver.find_element_by_xpath(&apo ...

Using Selenium to interact with a link's href attribute through JavaScript

New to Java and Selenium, I'm facing difficulties when trying to click on a link with JavaScript in href attribute. Here's the snippet from the page source: href="javascript:navigateToDiffTab('https://site_url/medications','Are y ...

Access information directly from an Excel spreadsheet without any alterations

When I extract data from an Excel sheet, I encounter a discrepancy in the format. For example, if the cell contains 30.44%, when I retrieve the data it appears as 0.3044. However, I wish to display the extracted data in its original format of 30.44% as i ...

Establishing a connection to the existing Selenium browser window using the session ID

I'm exploring ways to connect to an already existing browser window using Selenium RC. I came across a post on Exposing the selenium browser session id, which suggests that by obtaining the current session in Selenium RC, this can be achieved. Has an ...

continuously press secret button with selenium

I am encountering an issue with the display of listings on a web page, specifically regarding the functionality of the “Apply Now” button. The problem arises when I try to click on the button for the first listing and then proceed to fill out a dialog ...

Error message: Could not find the specified class using Selenium Standalone

I am facing an issue with my grails/groovy project which involves using the selenium standalone server for test automation. The project runs perfectly in IntelliJ, but when I try to run it in production mode, I encounter an error that I can't seem to ...

Tips for deactivating a Chrome extension using Selenium

Is there a way to prevent chrome extensions from starting up every time I run my Selenium Chrome code? Example Code public static void main(String[] args) throws IOException { System.setProperty("webdriver.chrome.driver", "C:\\ ...

Is it worth developing a QT C++ class specifically designed for storing parsed information from JSON text?

Question Summary Is it advisable to develop a class for storing information parsed from JSON text with QT C++? Are there better alternatives? NOTE! I'm limited to posting only two links due to being new, but if more information is needed to answer ...

Encountering a problem while attempting to utilize Selenium grid with the Microsoft Edge

I'm currently in the process of configuring a Selenium Grid for remote automated testing, and encountering an issue when trying to initiate a test on a Microsoft Edge node. To set up my node on a dedicated test machine, I utilized the following comma ...

Interacting with Discord Using Selenium in Python

Greetings, I am encountering a problem with the code snippet below. The specific issue is that after opening a submenu and attempting to send down arrow keys, it does not work properly unless I use a multiplier like *100. Any assistance on this matter wo ...

Exception thrown when Selenium encounters a timeout while trying to locate an element by

Having an issue with Selenium regarding a specific DOM structure: <div class="window__popup" style="display: block; transform: translateY(0px);"> ... <div id="user_product_name" class="input__block"> ... <input type= ...

Exploring the web with Python and Selenium for data retrieval

I'm currently working on a web scraping project where I need to extract data from a website that has a 'load-more' button in order to view the next 50 records. It's quite tedious as I have to keep clicking until all records are loaded. ...

Tips for verifying and controlling dropdown values using WebDriver?

Is there a way to check the status of percentage values in a drop-down, where some are enabled and others disabled? I am looking for a method to obtain the XPath of a specific value and determine if it is enabled or disabled. Click on the image below for ...

Selenium - Continued Testing in Current Window - Round 2

Seeking assistance in Selenium to loop a website every 15 minutes. I am looking for a way for the second and subsequent iterations to run in the same previous window rather than opening a new one. Any suggestions? ...

Having trouble locating the web element within a div popup while utilizing Node.js and WebdriverIO

I need assistance with a seemingly simple task. I am currently learning webdriverjs and attempted to write a short code to register for an account on the FitBit website at URL: www.fitbit.com/signup. After entering my email and password, a popup appears as ...

Looking to streamline your testing process by focusing solely on the desired test cases?

Our project currently has 200 test cases, however executing all of them is challenging. We are looking to run only a subset of these tests, specifically between 150 and 156. How can we achieve this in Selenium? Is it possible, and if so, how should we go ...

Troubleshooting problem with Firefox and Selenium: Firefox remains unresponsive despite being updated

I encountered an issue while running a functional test that involves opening a Firefox browser with Selenium. Despite trying to troubleshoot by updating Selenium and re-installing Firefox, the error message persists. Here's the detailed error message ...

Navigating back to the current page from a frame using Selenium Webdriver

What is the best method for returning to the main page from an iframe? For example: driver.SwitchTo.Frame(1); driver.SwitchTo().DefaultContent(); The above code snippet is not working. Does anyone have any alternative solutions to regain control? ...

Ensuring Checkbox State Verification with Robot Framework

Upon loading the page, I am attempting to check the state of checkboxes. If they are not already checked, my aim is to mark them as selected in order to establish a baseline before proceeding with further testing. To do this, I have employed the run keywo ...