0

I'm trying to get familiar with selenium. I decided to try to work with facebook, and fulfill my profile with selenium, But they use too much Ajax.

It's not very complicated to fulfill my hometown and so on, but I don't really know how to upload an image. They have an Ajax form to choose between upload and webcam photo. And then I need to handle somehow an upload dialog... any ideas?

Kate Paulk
31.5k8 gold badges56 silver badges109 bronze badges
asked Oct 9, 2013 at 11:45
2

1 Answer 1

1

You should be able to use the solutions outlined in this similar question on StackOverflow:

driver = webdriver.Firefox()
element = driver.find_element_by_id("fileUpload")
element.send_keys("myfile.txt")

This should allow you to interact with the file upload without automating the dialog box.

If you do need to interact with the dialog box, you'll need to use another library, as the dialog box is a Windows component and Selenium does not understand how to interact with Windows components, only with web pages.

answered Mar 11, 2014 at 20:05

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.