Answer the question
In order to leave comments, you need to log in
How to upload image to website via c# selenium chromedriver?
When you click on the button on the web page, a standard file upload window appears. Interested in the most universal way, suitable for most sites.
wd.FindElement(By.XPath("//button[.='Загрузить фото']")).Click();
new Actions(wd).SendKeys(@"C:\000.jpg").Build().Perform();
new Actions(wd).SendKeys(OpenQA.Selenium.Keys.Enter).Build().Perform();
Answer the question
In order to leave comments, you need to log in
why did you open the dialog? it is systemic..
you just need to substitute the path, as if it was opened and returned the path..
well, you can also google it in English))
quite sensibly with a bunch of examples.. at the very first link.
https://stackoverflow.com/questions/8851051/seleni...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question