Home > Back-end >  how do i work around 429 errors in selenium?
how do i work around 429 errors in selenium?

Time:10-18

I run into 429 errors a lot in selenium, because the driver is too fast for the server. this causes the website to get stuck (with no error message presented to the user). I use waits and I've tried using the sleep method but it doesn't always work. Is there anything I can do or is this a design flaw on the website - shouldn't the error be presented to the user so I can try to reload the page?

I am using incognito mode so cookies aren't an issue.

CodePudding user response:

try adding the bellow line of code after declaring the driver

driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));

also using sleep having assigned it a fair amount of time? make sure that it's using millescondes

thread.sleep(3000);

CodePudding user response:

It might be an issue that has to be handled in the source code of the application. I would do the following:

  1. Run a performance test and see if I can replicate it.
  2. Check the logs of the application to see if this happening frequently on production.

Please see following article for dev to handle 429 errors --> link

Otherwise the solution provided by @hamza belatra should be sufficient.

Unless it is a problem in your Test Architecture code, how to the driver is handled and so on.

  • Related