0

Automation in Selenium C#!

Im writing a test which involves clicking a button and uploading a file from a local harddrive.

I want to be able to close the windows explorer pop up that shows, i know selenium cant handle this very well, i was wondering if anyone has an knowledge of this?

Thanks Craig

2 Answers 2

2

No need to click on the browse button. Simply SendKeys it the file path then perform the save/upload operation.

    //browseButton here refers to the browse button element
      browseButton.SendKeys(fileToBeUploadedPath);
      saveButton.Click();
Sign up to request clarification or add additional context in comments.

Comments

1

The pop up could be an Alert.

Check that code in c#

IAlert alert = driver.SwitchTo().Alert();                                        
alert.Accept();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.