stagehand icon indicating copy to clipboard operation
stagehand copied to clipboard

bug: can't observe input type file

Open KrishavRajSingh opened this issue 6 months ago • 0 comments

Not able to observe input type file

await stagehand.init();

const page = await stagehand.page;
await page.goto("https://jobs.ashbyhq.com/primer.io/66430335-c4b6-4724-ba14-cf69e808075c/application?utm_source=LinkedInPaid", { waitUntil: 'domcontentloaded', timeout: 30000 });


const observations = await page.observe({
    instruction: "find all input file type element for resume",
    iframes: true
})
console.log(observations);

result:

[
  {
    description: "File upload element for resume with 'Upload File' button and drag-and-drop functionality",
    method: 'click',
    arguments: [],
    selector: 'xpath=/html[1]/body[1]/div[1]/div[2]/div[2]/div[2]/div[1]/div[2]/div[1]/div[3]/div[1]/div[1]'
  }
]

https://github.com/user-attachments/assets/96cc791e-53d7-4770-ad6f-bfec74d531ed

It would be nice if we can directly upload files, maybe something like setInputFiles but for stagehand where all i need to do is pass filepath as variable and it can act and upload the file instead of clicking on upload file button where human intervention is required.

KrishavRajSingh avatar Aug 20 '25 21:08 KrishavRajSingh