question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

make sure url remains set even when entering called features

See original GitHub issue

moving this comment into a new ticket for clarity: https://github.com/karatelabs/karate/issues/2202#issuecomment-1338690477

there was confusion about whether a url should “reset” when entering a “called” feature. I personally may have lost the original intent during some tricky refactoring and discussions

previous related threads: #2054 and #1990

but I have a couple more questions - there are 2 cases, when a call happens in “shared (global) scope” or “isolated (local) scope”: https://github.com/karatelabs/karate#shared-scope

my vote is: the url should be reset if the call is “isolated scope” because the intent is to call “with a clean slate”

and the url should behave just like it would in a single feature otherwise. which is to NOT reset when a call boundary is crossed

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
adrian-85commented, Dec 6, 2022

I actually looked for a configure option as my first solution. I think that would fit well with what the framework already does.

1reaction
ptrthomascommented, Dec 6, 2022

thanks all for your comments. this helps a lot

for reference - I don’t know when I added this to the docs, but it could be after this confusion started to emerge.

https://github.com/karatelabs/karate#call

image

anyway, I will acknowledge the need to change or mis-understandings on my part and move forward.

can we all agree that only the url is “carried across” the call boundary. in other words, headers and path and parameters will be “lost”.

we can take a decision to never reset the url within a Scenario no matter how many calls it goes through. one advantage of this approach is that it is easy to explain and there is no confusion

that said. I have a new suggestion. let me know if this makes sense:

* configure url = 'http://localhost:8080/v1'

so we introduce a new configure key. if you set it - it will be used throughout your tests, unless the user uses the url keyword !!

how does that sound, that seems to me that it is the best solution for all the issues being discussed. we already have configure headers so it is not a big stretch

let me know !!

Read more comments on GitHub >

github_iconTop Results From Across the Web

<input type="url"> - HTML: HyperText Markup Language | MDN
A Boolean attribute which, if present, means this field cannot be edited by the user. Its value can, however, still be changed by...
Read more >
URL Inspection Tool - Search Console Help - Google Support
Type the fully-qualified URL to inspect in the inspection search bar at the top of any Search Console screen. The URL must be...
Read more >
Move a Website and Change URL | Google Search Central
Learn how to change the URLs of existing site pages, including domain name changes. Explore moving a website with little impact on search...
Read more >
What Is a Website URL? The 3 Most Important Parts Explained
Struggling with what is a website URL? In this post, we'll answer that question and then break down the most important parts of...
Read more >
Use Link Preview in Outlook.com and Outlook on the web
If Link Preview is turned on, it automatically provides the site's name, description, and thumbnail image (if available) in the message body. Note:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found