Having trouble navigating through a pop-up window and trying to double click on the file

In order to double click on the folder named "Demos Business Story" in this dialog, it is necessary to scroll down as the folder is not initially visible. The folders are listed in alphabetical order within the dialog, so scrolling down is required to locate and double click on the specified folder. Unfortunately, attempts to scroll down using JS Executor have been unsuccessful.

How can we effectively scroll down in this dialog to access and double click on the desired folder? Without scrolling down, the folder remains out of view and inaccessible for clicking.

Folder name: Demos business Story

html:

<span class="CatalogObjectListListViewItem" title="Demos Business Story" tabindex="0">
<img class="CatalogObjectListItemSmallIcon" src="/analytics/res/v-eBAAmeYhUME/sk_Alta/catalog/folder.png" alt="Folder">
<span>Demos Business Story</span></span>

xpath used in code:
//span[contains(@class, 'CatalogObjectListListViewItem') and (@title='%1')]

I am unsure how %1 identifies the folder name within this xpath expression.

Efforts made:

((JavascriptExecutor)getDriver()).executeScript("scroll(0,400)");
//attempt to scroll down the dialog
doubleClick("elemSaveDialogListViewItem" + "(" + folder + ")");
//try to double click on the folder

Answer №1

To access the Demos Business Story section, you can utilize WebDriverWait along with elementToBeClickable() function using the provided locator.

WebDriverWait wait = new WebDriverWait(driver, 20); 
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//span[@class='CatalogObjectListListViewItem']/span[text()='Demos Business Story']"))).click();

Alternatively, you can click on the image tag instead.

WebDriverWait wait = new WebDriverWait(driver, 20); 
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//span[@class='CatalogObjectListListViewItem']/img[@class='CatalogObjectListItemSmallIcon']"))).click();

If unsure about the need for a double-click, you can employ the action class to perform a doubleClick() operation.

WebDriverWait wait = new WebDriverWait(driver, 20); 
WebElement clickElement = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//span[@class='CatalogObjectListListViewItem']/span[text()='Demos Business Story']")));
Actions action = new Actions(driver);
action.moveToElement(clickElement).doubleClick().build().perform();

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

Tips for displaying dynamic content in VueJS?

I'm currently working on an app that allows users to choose which type of vuetify element they want to display on the page. There are 4 options available for selection. My goal is to render the corresponding vuetify component when a user clicks on the ...

The issue of a jQuery slider malfunctioning when using an https URL on a Wordpress website

My WowSlider is experiencing issues on the main page of my Wordpress website with https. The images in the slider are stacked statically one after another. However, when the site is accessed with http, the slider works perfectly with the expected transitio ...

Real-time Calculation and Validation of Input Field Totals Using JQuery with Modulus % Rules

Hello, I need assistance with validating my input fields to accept values that are divisible by certain numbers. The criteria are as follows: inputValue % 10 == 0; inputValue % 20 == 0; inputValue % 50 == 0; inputValue % 100 == 0; inputValue % 200 == 0; ...

React is unable to assign a class field beyond the scope of axios

class App extends React.Component { app: Application; ... componentDidMound() { axios.get(…).then(res => { this.app.currentUser = res.data.data; // setting value inside lambda function. console.log(this.app.currentUser); // ...

Is there a way to retrieve all the values in a JSONObject while excluding any that are "null"?

Providing some background context: Within my org.json JSONObject, I have all the values of a JSON object retrieved from an API. "socialMedias" : { "TWITTER" : "[twitter url]", "YOUTUBE" : "[youtube url] ...

Form an object using elements of a string array

Trying to convert a string array into an object. The string array is as follows : let BaseArray = ['origin/develop', 'origin/master', 'toto/branch', 'tata/hello', 'tata/world']; I want the resulting obje ...

Having trouble getting the jQuery autocomplete feature to function properly?

On my page, there is a button labeled "Add a Skill." Clicking on this button should trigger the display of an input box where you can enter your skill, another input box for your skill level, and a horizontal slider to select the skill level. In my databa ...

Comparing react-intl and react-i18next for internationalizing ReactJS applications

I am in the process of developing a multilanguage application using ReactJS. This application will require a custom dictionary for various languages, as well as automatic formatting for date/time, numbers, and currency. After researching, I have come acro ...

looping through a linked data object with ng-repeat

I am working with a Node object in my Angular controller. Each Node contains a next property which points to the next item: $scope.Stack = function () { this.top = null; this.rear = null; this.size = 0; this.max_size = 15; ...

VSCode is experiencing issues with recognizing .env* files for markup purposes and is also failing to recognize .env.local.* files

Current Environment: Utilizing NextJs, React, and VsCode Noticing a problem with syntax highlighting in my VSCODE editor. I have installed the following extensions: ENV DotEnv As per suggestions, I updated my json configuration file as follows: " ...

Implementing a Push System without using node.JS

I am looking to develop a notification system similar to Facebook's, where notifications appear on the bottom-left side of the screen when someone interacts with your posts, for example. However, my challenge is that I need the server to send real-ti ...

The click function in the Actions class, when called with a WebElement parameter, does not actually perform

After attempting to use the click(WebElement) method from the Actions class to click on an element on the Google homepage, I encountered a problem where the click event did not actually occur. package p1; import org.openqa.selenium.interactions.Actions; i ...

Calculating variables in JavaScript

Explanation from Mozilla Documentation: console.log((function(...args) {}).length); // The result is 0 because the rest parameter is not counted console.log((function(a, b = 1, c) {}).length); // The result is 1 because only parameters before th ...

Troubleshooting: Why is my console.log not working in JavaScript

Recently, I've been diving into the world of JavaScript, but for some reason, I can't seem to make console.log function properly. At the top of my HTML document in the head section, I added jQuery like this: <script type="text/javascript" sr ...

Saving a PNG file results in an image that appears entirely black

I've been working on a paint program with various features, but I'm struggling to save the images correctly. Whenever I try to save a picture, it ends up appearing completely black. Any assistance would be greatly appreciated! (Please let me kno ...

Instructions for inserting text into a donut chart created with Google, utilizing basic HTML, JavaScript, or jQuery syntax

Are there any attributes in Google Chart that I should know about? I am just starting to use Google Charts and would appreciate some guidance. Here is the code snippet I am working with: function drawChart() { var data = google.visualization.arrayTo ...

What is the process for using the fetch method in React to upload a file?

Currently, I am developing a react component that involves uploading an Excel file to a server. Although my approach seems correct, it returns an empty object when I check the request body in console. <input type="file" id="avatar" name="avatar" onChan ...

Java Programming for XML Namespace Formatting

The API we are interacting with requires the following XML structure: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://blah.blah.blah"> <soapenv:Header/> <soapenv:Body> <api:Respon ...

find all occurrences except for the last of a pattern in javascript

When considering the patterns below: "profile[foreclosure_defenses_attributes][0][some_text]" "something[something_else_attributes][0][hello_attributes][0][other_stuff]" It is possible to extract the last part by utilizing non-capturing groups: var rege ...

Discover properties of a TypeScript class with an existing object

I am currently working on a project where I need to extract all the properties of a class from an object that is created as an instance of this class. My goal is to create a versatile admin page that can be used for any entity that is associated with it. ...