-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#42 - add upload step for uploading files
Previously casper.page.uploadFile can be used to upload a file. Uploading files is normally disabled by design due to security reasons. Otherwise malicious scripts from websites can upload user-private local data into their server. PhantomJS allows uploading of files by the uploadFile method which is explicitly designed to override this standard browser behavior. However, it is designed without support for XPath selector. Only CSS selectors can be used. For integration with Chrome, this method would be not usable. Thus the upload step is created to use a custom chrome.upload function to do uploading through Chrome Debugging Protocol’s supported method of DOM.setFileInputFiles. Only CSS selectors are supported now to be consistent with PhantomJS behavior. Also ran into issue when trying to use DOM.performSearch (no results returned). It seems that method is needed to search by XPath. Can be investigated further when decision is made to support XPath selector.
- Loading branch information
Showing
5 changed files
with
100 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters