Exploring NiFi: Techniques for targeting specific DOM elements using child element values

I need to retrieve an ID based on a specific logic in Nifi using Angular/jQuery. In this scenario, there may be multiple IDs with the same name due to the nature of Nifi.

Logic Outline

#connection-configuration-tabs-content
    #connection-settings-tab-content
        .settings-left
            .setting(2nd child)
                .setting-field
                    #connection-id (**GRAB**)
    #connection-details-tab-content
            #processor-source-name[title="ARCH_convertCSVToAvro"] (**if exist in this location**)
            #processor-destination-name[title="ARCH_convertAvroToORC"] (**and if exist in this location**)

The goal is to obtain the "connection-id" by referencing the locators of #processor-source-name[title="ARCH_convertCSVToAvro"] and #processor-destination-name[title="ARCH_convertAvroToORC"]. Although the connection-id varies for different processor names, I specifically want to target it based on the source/destination names.

How can I extract #connection-id under these conditions? Is there a way to achieve this when using Selenium in Java?

Purpose: To uniquely capture the "connnection" id in Nifi without relying on unique names from previous or subsequent processors (which are distinct in the workflow).

Answer №1

Consider using the following xpath:

//*[@id='connection-configuration-tabs-content' and (.//*[@id='processor-source-name' and @title='ARCH_convertCSVToAvro'] or .//*[@id='processor-destination-name' and @title='ARCH_convertAvroToORC'])]//*[@id='connection-id']

Answer №2

Is it possible to employ Selenium's WebDriver API in order to dynamically choose an element according to specific criteria? Additionally, one can make a request to NiFi's REST API for fetching the connection ID value associated with different connections on a processor.

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

Firefox not receiving output from Headless Selenium/Protractor

The tools and environment I am using for my project setup include: Firefox 30 selenium-server-standalone-2.43.1.jar Xvfb Ubuntu Headless Lineman grunt spec-e2e I have successfully executed Xvfb, Firefox, and lineman grunt spec-e2e wi ...

Incorporate personalized fonts onto your website

After downloading the Arimo font from Google Fonts, I decided to create a master page and a stylesheet for it. Here is the code I wrote: @font-face{ font-family:"Arimo"; src: url('../Fonts/Arimo/Arimo-Regular.ttf'),format('truetype& ...

"After clicking the button for the second time, the jQuery on-click function begins functioning properly

(Snippet: http://jsfiddle.net/qdP3j/) Looking at this HTML structure: <div id="addContactList"></div> There's an AJAX call that updates its content like so: <div id="<%= data[i].id %>"> <img src="<%= picture %&g ...

When the mandatory option is chosen, the scroll snap type acts similar to proximity by enforcing

My goal is to have the main hero section of the website take up the entire screen, and when the user scrolls down, they are immediately brought to the main content with the hero section no longer visible. However, I am experiencing an issue where if I do a ...

The margin-bottom attribute does not display any vacant area

I recently attempted to center the inner box within the outer box in this codepen. To achieve this, I utilized a workaround by applying margin-bottom: 20px;. However, it appears that this approach did not generate any visible space between the bottom line ...

Struggling to make images equal in size on my webpage [HTML/CSS]

When comparing two images, both 512px in height and width, the plus symbol appears larger than the shutdown button. HTML: <div class="logout"> <a href="someLink"> <img name="logout" alt="logout& ...

Both the attributes `name="button"` and `name="submit" are functioning correctly within the form

While working with Django framework, Interestingly, both name="button" and name="submit" function correctly upon submitting the form. {% buttons %} <button name="button" class='btn btn-primary'>Save</button> {% endbu ...

Conceal a class if the inline-block !important display property is applied to another class

I am trying to hide a class based on the display property of another class being set to inline-block !important, using only JavaScript. Here is my current code snippet: window.onload = function() { hidedeliveryFunction() { var outOfstock = d ...

Exploring Selenium Web Driver: Edureka's guide to managing exceptions without any output

As a beginner in Automation Testing, I am currently trying to expand my knowledge by learning from Youtube tutorials. One specific course from Edureka caught my attention as they demonstrated handling exceptions in their scripts, resulting in a message app ...

Merging string values from a file in Java

Looking to combine repeated strings in Java such as: A A B A B C A B D Desired outcome: A B C A B D The challenge lies in the fact that the strings are being read from a file, and this file contains over 10000 lines. Seeking an ef ...

Tips for assigning a consumer tag to an AMQP RabbitMQ in a Spring Boot application

The query posed in the post How can I change the consumer-tag value in a spring-amqp setup revolves around altering the consumer tag in Spring Amqp. One suggested solution is to implement the ConsumerTagStrategy. I am currently utilizing Spring Boot 2.0.5 ...

Decoding HTML with C#

When I use my program to visit a URL and read the resulting HTML, the process goes smoothly. string URI = "http://www.testwebsite.com/submit?q=+mydata"; string myParameters = ""; using (WebClient wc = new WebClient()) ...

Utilizing the input type file within an anchor tag to create a dropdown item

I am facing an issue while trying to incorporate the input type file within a dropdown item inside an anchor tag. Here is the code snippet causing the problem: <div className="dropdown-menu actions-text"> <a className="dropdown-item" href= ...

Choosing an option in a dropdown menu during ProtractorJS end-to-end testing

I need to automate the selection of an option from a dropdown menu for angular end-to-end tests using protractor. Below is the code snippet for the select option: <select id="locregion" class="create_select ng-pristine ng-invalid ng-invalid-required" ...

Deletion of ::before and ::after pseudo-elements upon addition of the class is-sticky

One issue I'm facing is that when the class is-sticky is applied to my menu, the ::before and ::after pseudo-elements on my logo become unnecessary. As I am not very proficient in JQuery, I have been unable to resolve this by searching online. The HT ...

Can you provide an explanation of the faults metric in mongostat?

I'm curious about the faults metric in mongostat. Currently, I am using mongo 2.0 on Ubuntu with a RAID-0 configuration consisting of two 32G disks. My test involves loading 5 million user profiles into mongo. I am performing this process in a single ...

What could be causing the mousewheel event in my code to remain active?

Whenever I try to scroll on Google Chrome, an error occurs on my website. jquery-3.3.1.min.js:2 [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See To resolve this issue: $(document).ready(f ...

Using HtmlUnitDriver to access a local HTML file

I have encountered an issue while trying to load a locally stored html file using the get() method of the HtmlUnitDriver. The page is not loading and when I tried to retrieve the page source, I received a 404 not found response. Interestingly, when I use t ...

Tips for choosing a specific P tag within a div tag in a hierarchical structure

How can I target the second <p> within the second <div> using CSS? Is there a way to create a hierarchy with CSS selectors? Please see the code snippet below: <!DOCTYPE html> <html> <head> <style> p:nth-of-type(2) { ...

Error message: The function 'close' is not recognized in Selenium Webdriver with Python

Why does it keep showing me the same error? NameError: name 'close' is not defined I also tried using quit() and it works, but I only need to close one browser. Here's the code snippet: def browser_func(): from selenium import webd ...