SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I get element identifiers for a webpage's file upload dialog?

    Hi, I would like to know some identifying attributes of a webpage's file upload dialog. Specifically I would like to know how to identify the filename textfield, the open button, and the cancel button. I can do this with either xpath and selenium or javascript(getElementById, getElementByName, etc.). I usually use firebug but clicking the button that enables me to highlight the desired element on the page in order to obtain the xpath does not work on the file upload dialog. How can I find out either the name, value, class, id, or any other identifying attribute for the file upload dialog's filename textfield, open button, or cancel button? Thanks.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,684
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by WebProducer View Post
    Hi, I would like to know some identifying attributes of a webpage's file upload dialog. Specifically I would like to know how to identify the filename textfield, the open button, and the cancel button. I can do this with either xpath and selenium or javascript(getElementById, getElementByName, etc.). I usually use firebug but clicking the button that enables me to highlight the desired element on the page in order to obtain the xpath does not work on the file upload dialog. How can I find out either the name, value, class, id, or any other identifying attribute for the file upload dialog's filename textfield, open button, or cancel button? Thanks.
    I don't think that that's possible. What are you wanting to achieve?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    I don't think that that's possible. What are you wanting to achieve?
    Thanks for responding. I am trying to automate uploading a file. I think it may be possible from http://stackoverflow.com/questions/3...er-file-upload ; unfortunately the id they specified, 'fileName', doesn't work on my website. I am trying to find out how I can find the value of this id, or of a name, or of a value, etc. because I haven't been able to with either Firebug or Xpath checker.

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,684
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by WebProducer View Post
    Thanks for responding. I am trying to automate uploading a file. I think it may be possible from http://stackoverflow.com/questions/3...er-file-upload ; unfortunately the id they specified, 'fileName', doesn't work on my website. I am trying to find out how I can find the value of this id, or of a name, or of a value, etc. because I haven't been able to with either Firebug or Xpath checker.
    They are affecting the file input field. You don't have the control to affect anything in regards to the dialog itself.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •