Hi all, I'm having some trouble converting a piece of code from python to c#.
This piece of code is supposed to wait for the user to finish the recaptcha before continuing. The field "g-recpatcha-response" is populated in the HTML once a recaptcha is solved. The python code works perfectly fine, but the c# version seems to find the "g-recpatcha-response" field immediately and continues without waiting. The two pieces of code seem identical, so I'm not sure what's going on.
Any help would be much appreciated!
Python:
driver = webdriver.Chrome()
try:
WebDriverWait(driver, 60).until(EC.text_to_be_present_in_element_value((By.NAME, "g-recaptcha-response"), ""))
print("Success")
time.sleep(1)
except TimeoutException, err:
print("Timeout")
return
C#:
using (IWebDriver driver = new ChromeDriver);
{
try
{
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));
wait.Until(ExpectedConditions.TextToBePresentInElementValue(By.Name("g-recaptcha-response"),""));
System.Threading.Thread.Sleep(1000);
}
catch
{
return;
}
}