N
N
NonameProgrammer2021-07-14 07:54:52
.NET
NonameProgrammer, 2021-07-14 07:54:52

Why is Selenium for c# slow?

There is this code

public static IWebElement GetButton(this WebDriverWait webDriverWait, string xpath)
        {
            var button = webDriverWait.Until(ExpectedConditions.PresenceOfAllElementsLocatedBy(By.XPath(xpath)))
                .FirstOrDefault();
            return button;
        }

Request
webDriverWait.GetButton("//a[@class=\"button projectDetails\"][text()=\"text\"]").Click();

Paying attention to PresenceOfAllElementsLocatedBy is probably not worth it, since I tried completely different ECs to check for the presence and accessibility of an element.
The browser is launched without the "-headless" parameter. Unfortunately, this option cannot be used. It takes about 1-2s to search for an element, which is quite a lot for my purposes. Is there any way to fix the performance (but that's the question. Is it a problem with my code or with geckodriver )?

Thanks in advance for your replies.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NonameProgrammer, 2021-07-14
@NonameProgrammer

The question is removed. The reason was in the original project on the Net Core platform.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question