web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / PAD - fail to click on...
Power Automate
Unanswered

PAD - fail to click on image based on text

(0) ShareShare
ReportReport
Posted on by 6

Hi guys,

 

I need help.

 

I have to click on image that there is no id or text associated. I can not use the div id, due to it is dynamic. I can click on text beside the image (another td), using the id or text, it is fixed (ex id=2180). But I can not click on highlighted image.

 

I´ve tried many options .. like:

 

td[contains(text(), 'INTEGRAÇÃO SIGA2 - SECRETARIA DIGITAL IDE')]/preceding::td/img[contains(@src, 'treeimgs/tree/point.gif')]

tr[td[contains(text(), 'INTEGRAÇÃO SIGA2 - SECRETARIA DIGITAL IDE')]]//img[contains(@src, 'treeimgs/tree/point.gif')]

 

 

raphaelsaraiva_0-1719322588418.png

 

I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,255 Moderator on at

    @raphaelsaraiva 

     

    Try something like below:

    Deenuji_0-1719335376550.png

     

    Javascript code used:

    function ExecuteScript() { 
    // Step 1: Select the image element based on its src attribute
    const srcValue = '../../common/baseclass/imgs/treeimgs/tree/point.gif';
    const imgElement = document.querySelector(`img[src="${srcValue}"]`);
    
    if (imgElement) {
     // Step 2: Navigate to the parent element (td)
     const parentElement = imgElement.parentElement;
    
     if (parentElement) {
     // Step 3: Trigger a click event on the parent element
     parentElement.click();
     } else {
     console.error('Parent <td> element not found.');
     }
    } else {
     console.error('Image element with specified src attribute not found.');
    }
     }

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

     

  • raphaelsaraiva Profile Picture
    6 on at

    Hi, Deenuji

     

    Thanks for the help.

     

    I have many  '../../common/baseclass/imgs/treeimgs/tree/point.gif';  on html. It is a list of elements. The above is only one example.

     

    raphaelsaraiva_0-1719351102241.png

     

     

     

     

  • raphaelsaraiva Profile Picture
    6 on at

    I can solve the problem.

     

    function ExecuteScript() { 
        // Obtém o elemento com o ID "2180"
        element = document.getElementById("2180");
        
        // pegar o tr acima
        parentElement = element.parentElement;
          
        // pegar o primeiro td do tr - que é onde está a img a ser clicada
        firstElement = parentElement.firstElementChild;
       
        imgElement = firstElement.firstElementChild;
        
        imgElement.click();

    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 482

#2
11manish Profile Picture

11manish 280

#3
David_MA Profile Picture

David_MA 268 Super User 2026 Season 1

Last 30 days Overall leaderboard