-1

enter image description here

How can we resolve this

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Mar 09 '23 at 11:53
  • Does this answer your question? [How to click on a Chrome extension button with Selenium](https://stackoverflow.com/questions/51524109/how-to-click-on-a-chrome-extension-button-with-selenium) – Rolandas Ulevicius Mar 09 '23 at 13:55
  • Maybe [answer](https://stackoverflow.com/a/51524957/20443541) helps you:) – kaliiiiiiiii Mar 14 '23 at 07:25

1 Answers1

0

Now I am using Sikulix to click on the extension as it works on the GUI rather than Element location. Pattern iconLight = new Pattern("C:\Users\HemantAttri\Pictures\e"); Pattern iconDark = new Pattern("C:\Users\HemantAttri\Pictures\ei");

    // Create a screen region to search for the icon
    

    // Search for the icon and click on it
    Match icon = null;
    if (screen.exists(iconLight) != null) {
        // Use the light theme icon
        icon = screen.exists(iconLight);
    } else if (screen.exists(iconDark) != null) {
        // Use the dark theme icon
        icon = screen.exists(iconDark);
    }
    if (icon != null) {
        icon.click();
    } else {
        System.out.println("icon was not found"); 
        
    }