healenium / healenium-web

Self-healing library for Selenium Web-based tests
Apache License 2.0
170 stars 40 forks source link

[BUG]: Explicit wait condition is not working in healenium #263

Closed likith-zomentum closed 3 weeks ago

likith-zomentum commented 9 months ago

Describe the bug

I have seen that in healenium-web v 3.4.8 the expected conditions are throwing error [main] ERROR healenium - Failed to get element node path! for me personally i have checked with ExpectedConditions.elementToBeClickable();

How to reproduce the issue

Take any WebElement element and wait for it using the expected conditions in SelfHealingDriverWait

Logs appeared during using Healenium

[main] ERROR healenium - Failed to get element node path!
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.lang.String` from [Unavailable value] (token `JsonToken.NOT_AVAILABLE`)
 at [Source: UNKNOWN; byte offset: #UNKNOWN]
    at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
    at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1752)
    at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1526)
    at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1473)
    at com.fasterxml.jackson.databind.deser.std.StdDeserializer._parseString(StdDeserializer.java:1456)
    at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:48)
    at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:11)
    at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)
    at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:4801)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2974)
    at com.fasterxml.jackson.databind.ObjectMapper.treeToValue(ObjectMapper.java:3438)
    at com.epam.healenium.service.NodeService.toNode(NodeService.java:76)
    at com.epam.healenium.service.NodeService.getNodePath(NodeService.java:54)
    at com.epam.healenium.SelfHealingEngine.lambda$getNodePath$0(SelfHealingEngine.java:121)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
    at java.base/java.util.Collections$2.tryAdvance(Collections.java:4747)
    at java.base/java.util.Collections$2.forEachRemaining(Collections.java:4755)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
    at com.epam.healenium.SelfHealingEngine.getNodePath(SelfHealingEngine.java:122)
    at com.epam.healenium.SelfHealingEngine.saveElements(SelfHealingEngine.java:104)
    at com.epam.healenium.processor.FindElementProcessor.execute(FindElementProcessor.java:25)
    at com.epam.healenium.processor.BaseProcessor.process(BaseProcessor.java:42)
    at com.epam.healenium.handlers.proxy.BaseHandler.findElement(BaseHandler.java:63)
    at com.epam.healenium.handlers.proxy.SelfHealingProxyInvocationHandler.invoke(SelfHealingProxyInvocationHandler.java:39)
    at com.sun.proxy.$Proxy35.findElement(Unknown Source)
    at org.openqa.selenium.support.pagefactory.DefaultElementLocator.findElement(DefaultElementLocator.java:68)
    at org.openqa.selenium.support.pagefactory.internal.LocatingElementHandler.invoke(LocatingElementHandler.java:38)
    at com.sun.proxy.$Proxy38.isDisplayed(Unknown Source)
    at org.openqa.selenium.support.ui.ExpectedConditions.elementIfVisible(ExpectedConditions.java:304)
    at org.openqa.selenium.support.ui.ExpectedConditions.access$000(ExpectedConditions.java:37)
    at org.openqa.selenium.support.ui.ExpectedConditions$10.apply(ExpectedConditions.java:290)
    at org.openqa.selenium.support.ui.ExpectedConditions$10.apply(ExpectedConditions.java:287)
    at org.openqa.selenium.support.ui.ExpectedConditions$23.apply(ExpectedConditions.java:656)
    at org.openqa.selenium.support.ui.ExpectedConditions$23.apply(ExpectedConditions.java:652)
    at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:205)
    at com.epam.healenium.SelfHealingDriverWait.until(SelfHealingDriverWait.java:37)

Expected behavior

No response

Actual behavior

No response

Healenium Web version

3.4.8

Healenium Backend version

3.4.2

Selenium version

4.4.1

Platform

Java

Properties file

No response

Additional context

No response

Alex-Reif commented 7 months ago

Hi @likith-zomentum , Could you provide html page you reproduce the issue? According to your logs some kind of element has unusual types attributes. Default map of attribute to type: tag - string, index - int, innerText - string, id - string, classes - string[]

Alex-Reif commented 3 weeks ago

Fixed at rev. 3.5.4