0

Getting an error while trying to run a script using Rest-Assured library along with Selenium. Anyone has encountered this kind of error while scripting with Rest-Assured. My code is scattered across multiple classes so difficult to post here, so if anyone can give me some idea on this error it would be helpful.

Note: I have used ObjectMapper and JsonNode classes for updating a json file with dynamic value fetched from the previous api response and then passing the updated json file into the request body of the second api. Below error comes even before the test starts.

java.lang.StackOverflowError
    at java.base/java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3950)
    at java.base/java.util.regex.Pattern$GroupHead.match(Pattern.java:4791)
    at java.base/java.util.regex.Pattern$Branch.match(Pattern.java:4736)
    at java.base/java.util.regex.Pattern$Branch.match(Pattern.java:4734)
    at java.base/java.util.regex.Pattern$Branch.match(Pattern.java:4734)
    at java.base/java.util.regex.Pattern$BranchConn.match(Pattern.java:4700)
    at java.base/java.util.regex.Pattern$GroupTail.match(Pattern.java:4850)
    at java.base/java.util.regex.Pattern$BmpCharPropertyGreedy.match(Pattern.java:4331)
    at java.base/java.util.regex.Pattern$GroupHead.match(Pattern.java:4791)
    at java.base/java.util.regex.Pattern$Branch.match(Pattern.java:4736)
    at java.base/java.util.regex.Pattern$Branch.match(Pattern.java:4734)
    at java.base/java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3951)
    at java.base/java.util.regex.Pattern$Start.match(Pattern.java:3606)
    at java.base/java.util.regex.Matcher.search(Matcher.java:1729)
    at java.base/java.util.regex.Matcher.find(Matcher.java:773)
    at java.base/java.util.Formatter.parse(Formatter.java:2702)
    at java.base/java.util.Formatter.format(Formatter.java:2655)
    at java.base/java.util.Formatter.format(Formatter.java:2609)
    at java.base/java.lang.String.format(String.java:2897)
    at com.codeborne.selenide.conditions.Text.toString(Text.java:37)
    at java.base/java.lang.String.valueOf(String.java:2951)
    at java.base/java.lang.StringBuilder.append(StringBuilder.java:168)
    at com.codeborne.selenide.impl.CollectionElementByCondition.getSearchCriteria(CollectionElementByCondition.java:50)
    at com.codeborne.selenide.impl.SelenideElementProxy.invoke(SelenideElementProxy.java:63)
    at com.sun.proxy.$Proxy27.parent(Unknown Source)
  • 1
    You are obviously running into infinite recursion. Try to localize your issue and post minimal representative example. Without having the code no one will even guess.. – Alexey R. Oct 16 at 17:15
0

Looking at that stracktrace, the regular expression used for the matching is recursing infinitely causing a stackoverflow exception. Your search criteria is likely being translated into a regex without properly formatting your search criteria first. Have a look if there is a \ or * in your searchcriteria and whether you need it.

| improve this answer | |
New contributor
anichols is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.