1

I have a web page, while loading the page it has one more call, for this call I need to change the base url

the below is the code snippet.

 // url : www.abc.com/....
 final WebDriverWrapper webDriverWrapper = webdriver.generateChromedriver();
 final WebDriver driver = webDriverWrapper.getDriver();
 driver.get(url);
 driver.manage().timeouts().implicitlyWait(90, TimeUnit.SECONDS);

For example I'm loading this url www.abc.com/getDetails...... While loading this, this page has one more call

getInnerDetails

This getInnerDetails I need to call like below. www.xyz.com/getInnerDetails

I'm new to this area, please give me some input. Is it possible to change the url like this in selenium.

But now the call gets failed since it is loading like this www.abc.com/getInnerDetails

Ganesan S
  • 85
  • 1
  • 3
  • 13
  • Does this answer your question? [Changing URL using WebDriver](https://stackoverflow.com/questions/14387918/changing-url-using-webdriver) – Marc Aug 03 '20 at 09:50
  • I tried it, but that is entirely different request. For me, both are on single page. – Ganesan S Aug 03 '20 at 10:28
  • Answer shared by @marc should work. please share your code snippet and the error that you are getting. – Dora Aug 04 '20 at 07:06
  • driver.get("www.abc.com/getDetails"); While loading abc.com to show one component in the same page, I have one more API call ie www.xyz.com/getInnerDetails Hence I need to change the base url from abc to xyz to make separate api call. – Ganesan S Aug 04 '20 at 07:33
  • My page is loading successfully with this url www.abc.com/getDetails..... And my another API is call is failing because the url is loading like this www.abc.com/getInnerDetails...... instead of www.xyz.com/getInnerDetails. – Ganesan S Aug 04 '20 at 07:39

0 Answers0