Selenium with C# 60 - File Uploading in Chrome & Firefox using IWebElement SendKeys method
Вставка
- Опубліковано 6 вер 2024
- File Uploading in Chrome & Firefox using IWebElement SendKeys method
#selenium #fileupload #csharpselenium #seleniumcsharp
Analyzing file upload control
Uploading the file in Chrome and Firefox
Possible Interview Questions on selenium file upload.
How to upload a file in Chrome browser?
How to upload a file in Firefox browser?
Code for selenium c# file upload
[TestMethod]
public void FileUpload()
{
IWebDriver driver = new FirefoxDriver();
driver.Manage().Window.Maximize();
driver.Url = "uitestpractice....";
driver.FindElement(By.Id("image_file")).SendKeys(@"C:\Users\ANKIT\Desktop\youtube-subscribe-button-transparent-background-hd-png-download.png");
Thread.Sleep(4000);
driver.Quit();
}