How does everyone bypass the HttpClient.Timeout problem?

I encounter it consistently on a select set of my tests where they have to fetch the text from an element, and then tap on a descendant element if a certain condition passes. It has to do this about a hundred times and sooner or later fails like this:

OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://127.0.0.1:59604/session/8f564963-343d-4110-9732-014524fca56d/element/00000000-0001-e9ea-ffff-ffff00000066/text timed out after 60 seconds.
----> System.Threading.Tasks.TaskCanceledException : The request was canceled due to the configured HttpClient.Timeout of 60 seconds elapsing.
----> System.TimeoutException : The operation was canceled.
----> System.Threading.Tasks.TaskCanceledException : The operation was canceled.
----> System.IO.IOException : Unable to read data from the transport connection: Operation canceled.
----> System.Net.Sockets.SocketException : Operation canceled
Stack trace
at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.Appium.Service.AppiumCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.WebElement.get_Text() at OpenQA.Selenium.Appium.AppiumElement.CacheValue(String key, Func1 getter)
at OpenQA.Selenium.Appium.AppiumElement.get_Text()

What’s interesting is that I encounter this with appium 2.x, dotnet client 5.x and selenium 4+.
With appium 1.22, selenium 3.141 and a compatible dotnet client this would never happen at all. Possibly because I was using FindsBy attributes then, and I’m no longer using them now, I’m not sure.

Anyway, I’ve seen other people run into this error and I’m wondering how do you bypass it?
I was thinking of implementing some extension methods with retry strategy for fetching text, location, etc., on each method I encountered this on.
Is there a better way?

I ended up going the extension methods route. For situations where I encountered this issue (mostly fetching text and Location) I created extension methods like this:

// This is essentially <some_appium_element>.Text, but it tries a little harder.
public static string AutomationText(this AppiumElement element)
{
    string placeholder;
    try
    {
        placeholder = element.Text;
    }
    catch (WebDriverException e) when (e.InnerException.Message.Contains("HttpClient.Timeout"))
    {
        // One retry
        placeholder = element.Text;
    }

    return placeholder;
}

I don’t think it is the best thing to do but it does the job.

try → Capabilities - Appium Documentation → newCommandTimeout → increase to something more then 60 sec

I do use that capability, unfortunately the appium client rc1 ignores it…

I did see a contributor commit a fix for it, it should be included in rc2 which is past due…

Anyway, The problem I’m having is (I think) this:

In which case, increasing the time to say, 100, will just make the error display configured HttpClient.Timeout of 100 seconds and not fix anything.