Problem Statement: In my application there is a token which is unable to generate it from the api call directly and other way because the it is implemented with OAUTH. So I took a detour and automate it through API. by using Webdriver sampler. with following script.
WDS.sampleResult.sampleStart()
WDS.browser.get('appurl');
java.lang.Thread.sleep(10000);
WDS.browser.findElement(org.openqa.selenium.By.id("details-button")).click();
WDS.browser.findElement(org.openqa.selenium.By.id("proceed-link")).click();
WDS.browser.findElement(org.openqa.selenium.By.id("i0116")).sendKeys("username"); //enter user name and password in login.microsoft.com
WDS.browser.findElement(org.openqa.selenium.By.id("idSIButton9")).click();
WDS.browser.findElement(org.openqa.selenium.By.id("i0118")).sendKeys("password");
WDS.browser.findElement(org.openqa.selenium.By.id("idSIButton9")).click();
WDS.browser.findElement(org.openqa.selenium.By.id("idSIButton9")).click();
//WDS.sampleResult.sampleEnd()
This works fine and I am able to retrieve the token by using regex extractor.

Using the Token in API Call and getting retry error
JMeter Failure (getting IO error exceeded number of retry =, tried with 20, 50 ,200 and now 500)
Suspecting the session id may be I am not transferring or is there anything I am missing (remember I am not terminating the browser session)



