Recently started working on Leap test tool in automation

Hi
I have started automation using Leap test tool . But I am getting error web element was found but not clickable .
Please help me to resolve this issue

Can you provide more information? Screen shot perhaps?

Hello Satveer. Leaptest Support can definitely help you. They are available via the pop-up chat on Leaptest.com

Best regards,
Aske, Leaptest

1 Like

@Aske Yeah I have tried it looks good for automation but It is not always executable It gives me error web elelment was found but not clickable …

When you are looking at a web page there are three dimensions. You have left/right and up/down but there is a third dimension called z-order. For example,

<div class='foo'><span class='bar' onclick='javascript goes here'><a href="some http link">Click Me</a></span></div>

When you look at this on the screen you just see the “Click Me” text but it is actually three layers deep.

When you get the message that a web element was found but it was not clickable, WebDriver is saying that the element you are trying to click is underneath another element. In my example, the SPAN has an onclick attribute. If you try to click the anchor (the A element), the click will get captured by the SPAN and the anchor might be unclickable. So driver.findElement(By.text(“Clcik Me”)).click() might fail with the not clickable message.

An even more common reason is a guard or a modal. For example, a guard is used when a developed doesn’t want you to double click something or click something before their javascript is ready. I might code something such that when you click a link, I set the to be opaque. This means everything on the page is unclickable. I then initialize some javascript and finally I make the transparent (everything is clickable again).

With a human what happens is:

  1. Click something
  2. BODY goes opaque
  3. Javascript initializes in 250 ms
  4. BODY goes transparent
  5. human clicks the next element

Steps 2 to 4 happen so quickly, you might not even see it. But WebDriver is a LOT faster than a human. So what happens with WebDriver is:

  1. Click something
  2. BODY goes opaque
  3. WebDriver tries to click the next element
  4. web element was found but not clickable
  5. Javascript initializes
  6. BODY goes transparent

A bad way to solve this is just add a sleep statement. For example:

  1. Click something
  2. sleep for 5 seconds
  3. BODY goes opaque
  4. Javascript initializes in 250 ms
  5. BODY goes transparent
  6. sleep expires
  7. WebDriver clicks the next element

In WebDriver code this would be:

  1. Click something
  2. sleep 5 seconds
  3. WebDriver clicks the next element

If you try this and it works, you can make it better by using WebDriverWait. For example,

  1. Click something
  2. WebDriverWait wdw = new WebDriverWait(driver, 5);
  3. WebElement nextElement = driver.findElement(the next element)
  4. wdw.until(ExpectedConditions.clickable(nextElement));
  5. WebDriver clicks the next element

There are subtle difference depending on exactly what is happening in your case. Posting an example might help.

Darrell

1 Like

Hi Satveer, Please check following article "I am getting error “Web element was found but not clickable” in Leaptest knowledge base to get resolution of your issue.

Best regards,
Praveen, Leaptest

1 Like

Thanks @Parveen . Great! It is very useful for me .