The element cannot be clicked at this point as another element would intercept the click:

Having an issue with clicking a button at the top of the page. The CSS selector works fine in my local Eclipse environment, but when trying to run it on Jenkins server on my local machine, it fails with an error stating that the element is not clickable. The screenshot from the failed test on Jenkins shows that the header is overlapping the button that needs to be clicked. I have tried various solutions using XPath, CSS, moving to the element, and moving the mouse, but nothing seems to work. Any assistance would be greatly appreciated.

I'm attempting to click on the 'Add' button.

org.openqa.selenium.WebDriverException: Element is not clickable at point (775.25, 10.166671752929688). Other element would receive the click: <div class="globalHeader-UtilTop"></div>
Command duration or timeout: 69 milliseconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host', ip: '', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_80'

<div class="Componet-intels**strong text**-Container">
<div class="Componet-intels-Container-Header">
<div class="Componet-intels-Container-Content">
<div class="Componet-intels-Container-Content-Row">
<span class="Componet-intels-Item"> Item # </span>
<span class="Componet-intels-Text-Item">
<span class="Componet-intels-Lable-Quantity"> Qty: </span>
<span class="Componet-intels-Text-Quantity">
<span class="Componet-intels-Button">
**<input class="Componet-intelsButtonIcon" type="button" value="Add">**
</span>
</div>

Answer №1

Issue: Unable to click on element at coordinates (775.25, 10.166671752929688). Another element is intercepting the click.

The problem seems to be that the desired element is being obscured by a different div element, causing it not to be clickable.

Possible solutions could involve adjusting the UI layout so that the header does not hide the target element. Alternatively, you can try the following steps:

  1. Attempt maximizing the browser window using WebDriver to check if the header no longer obstructs the element

    driver.manage().window().maximize() 
    
  2. Utilize JavaScript for clicking on the element

    WebElement element = driver.findElement(By.<locator>);
    JavascriptExecutor executor = (JavascriptExecutor)driver;
    executor.executeScript("arguments[0].click()", element)`
    

Answer №2

Implement JavascriptExecutor for your automation task:

Locate the element using driver.findElement(By.<locator>);

JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("arguments[0].click()", element);

Answer №3

In my particular situation, I encountered a scenario where I needed to interact with a button that only became visible after several graphs had loaded along with an ajax image. To resolve this issue, I followed the steps below:

  1. Firstly, locate the xpath/css element that disappears upon completion of the ajax call and explicitly wait for it to become invisible using

    wait.until(ExpectedConditions.invisibilityOf(element));

  2. Next, add another explicit wait for the button to be clickable by using

    wait.until(ExpectedConditions.elementToBeClickable(element));

  3. Finally, utilize JavaScript to simulate clicking on the button-

    WebElement element = driver.findElement(By.xpath(""));
    JavascriptExecutor js = (JavascriptExecutor)driver;<br>
    js.executeScript("arguments[0].click()", element);

If these steps do not yield the desired result, consider inserting an implicit wait between step 1 and 2.

Answer №4

During my Salesforce automation with Robot Framework and Chrome browser, I encountered an error that was causing inconvenience. Fortunately, the issue was resolved by utilizing the key press event method using (Press Keys ${locator} RETURN) as a replacement for the 'Click Element' or 'Click Button' keywords.

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

JPQL Query Fails to Sort Results Using ORDER BY

I need help with a method that retrieves a HashMap based on a user's department and building, ordering the results alphabetically by user name. private HashMap<Long, String> getCriticalPde(long departmentId, long buildingId) { HashMap<Lo ...

Using Selenium to automate pressing the login button on Discord

Can anyone assist me with automating the login process for my Discord account using Python and Selenium? I keep encountering an error when trying to click the login button. Here is a snippet of my code: import time from selenium import webdriver from sele ...

Oops! Looks like we have encountered an issue with reading the property 'checked' of nothing

Whenever I click the checkbox, an image should be displayed. Unfortunately, I encountered an error: Uncaught TypeError: Cannot read property 'checked' of null at (index):185 at dispatch (VM576 jquery.min.js:3) at i (VM5 ...

What is the best way to mark a MenuItem as active within a Material UI Drawer component?

Here is the code snippet I am working with: <Drawer docked = {false} width = {330} open = {this.state.drawerOpen} onRequestChange = {(drawerOpen) => this.setState({drawerOp ...

"Enhancing the aesthetics: Stylish blue borders around Bootstrap

After successfully setting up bootstrap-select, I have noticed that blue borders are showing in two specific instances: 1) within the dropdown menu 2) when a new value is selected I have made some adjustments but the issue persists. Can someone please p ...

Using gradients in the app bar with ReactJS and Material UI is not currently supported

Recently, I decided to create my own custom appbar for a personal project and opted to use the Erica One font. As it is still in its initial stages, there isn't much code written yet. However, I've encountered two issues related to linear and ra ...

The custom CSS styling is triggered only when the page is resized in Bootstrap

Currently, I am utilizing bootstrap alongside my custom CSS. The issue I am facing is that some of the styling from my custom CSS only takes effect after resizing my browser window to a smaller size. My custom CSS seems to be applied when the website adapt ...

javascript alter css property display to either visible or hidden

I am struggling with a CSS id that hides visibility and uses display: none. The issue arises when I want the element to be visible upon clicking a button, but removing the display:none property is causing design problems due to it being an invisible elemen ...

What is the best way to prevent the child elements from inheriting the hover effect of the main container?

Looking to spice up the appearance of the div element that holds the product's image, SKU, and price. Adding a hover effect to the main container causes the child divs to inherit it, resulting in separate hover effects on each child div. Sample HTML ...

Issue with the react-native-autocomplete-input where the list does not close after selecting an option

After selecting an item from the list in my react-native-autocomplete-input, the list does not close. let Location = (props) => ( <View style={styles.formItem}> <Autocomplete data={props.autocompleteResults.predictions} de ...

Using Javascript to Trigger Events on Selection

I have a unique situation: 1) One of my dropdown's choices features various car names. 2) Another dropdown has two options: When selecting each option in the second dropdown, the following should occur: a) Choose UserInput - This action will hide ...

What strategies can I use to locate elements containing specific strings within an id using selenium?

Currently, I am developing a basic web crawler to extract retweet counts from Twitter. However, I have encountered an issue with the following code snippet: <span class="ProfileTweet-actionCountForAria" id="profile-tweet-action-retweet-co ...

In Laravel Blade, you can dynamically add rows and columns based on a certain condition

I'm working on creating a user interface for cinema seats in Laravel Blade. The database includes seat rows and columns, and the rows will be the same for two consecutive rows. For example, the first row could have an id of 1 with seat_row:1 and seat_ ...

Using WebDriver to select a checkbox based on the value within a span element

Looking to check the checkbox associated with "Costco Wholesale Corporation" in the table: <td role="gridcell" style="" title="" aria-describedby="entity-search-grid_selected"> <input type="checkbox" name="chkbox" class="itmchk" value="110504"& ...

The dropdown menu is unable to open directly below the main menu item

How can I make the submenu open to the left when hovering over a menu point, instead of directly under it? I have tried adjusting the position attributes but haven't found the right solution yet. The closest I got was by changing the display property ...

How to show a tooltip inline by utilizing CSS styling

Working on a sticky side bar menu with a tooltip feature. While it appears correctly in Chrome and Safari, the tooltip is off-center in IE. This snippet seems to be causing the issue: /* Vertically center tooltip content for left/right tooltips */ .tool ...

Retrieve data from a webpage without the need for parsing using Json AsyncTask

Having some trouble with Java, I just need to extract the content of this page without parsing it: {"base":"USD","date":"2016-12-12","rates":{"RON":4.2538}} import android.os.AsyncTask; import android.support.v7.app.AppCompatActivity; ...

Floating footers with centered content - they remain aligned in the center even when zoomed out

Behold my unique and straightforward footer design (100% zoom above, 70% zoom below) : To keep things simple, I aimed to center content with a single div having a fixed width and margin: 0 auto, all while maintaining the same color for the outer footer la ...

Experiencing a Stack Overflow Error while attempting to log using log4j

When conducting test automation, I utilize log4j for logging purposes. Here is the method I use to write logs: public class Log { private static Logger Log = Logger.getLogger(Log.class.getName()); public static void info(String message) { Log.info ...

Locate the table cell that contains certain text, then identify its surrounding elements such as parent elements and

Currently, I am working on a task that involves finding a specific <td> element in a table using Python Selenium. I have successfully located the element based on certain text content it contains. However, upon calling the parent method on the select ...