Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9296957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:57:05+00:00 2026-06-18T21:57:05+00:00

I am using Mink and Sahi for my user interface tests inside a Symfony2

  • 0

I am using Mink and Sahi for my user interface tests inside a Symfony2 application. But actually I can’t manage to upload a file with Sahi.

My Sahi server is up and running:

[09:51:33] coil@ubuntu:~/Webdev/sahi/bin$ ./sahi.sh 
--------
SAHI_HOME: ..
SAHI_USERDATA_DIR: ../userdata
SAHI_EXT_CLASS_PATH:
--------
Sahi properties file = /home/coil/Webdev/sahi/config/sahi.properties
Sahi user properties file = /home/coil/Webdev/sahi/userdata/config/userdata.properties
Added shutdown hook.
>>>> Sahi started. Listening on port: 9999
>>>> Configure your browser to use this server and port as its proxy
>>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Controller
-----
Reading browser types from: /home/coil/Webdev/sahi/userdata/config/browser_types.xml
-----

My step implementation:

    // $element->getXpath() --> (//html/descendant-or-self::*[@id = 'attachment'])[1]
$element->attachFile($file);

Note here that if I use a file that is not /home/coil/Webdev/sahi/userdata directory, I get the following error:

$element->attachFile('toto');
error:_setFile2(_byXPath("(//html/descendant-or-self::*[@id = 'attachment'])[1]"), "toto")
      Error: File not found: toto; Base directory is userdata directory: /home/coil/Webdev/sahi/userdata
      Error: File not found: toto; Base directory is userdata directory: /home/coil/Webdev/sahi/userdata
      at Sahi._setFile (http://dev.project.com/_s_/spr/concat.js:1398:12)
      at Sahi._setFile2 (http://dev.project.com/_s_/spr/concat.js:1367:7)
      at eval (eval at <anonymous> (http://dev.project.com/_s_/spr/concat.js:3480:14), <anonymous>:1:7)
      at Sahi.ex (http://dev.project.com/_s_/spr/concat.js:3480:9)
      at <anonymous>:1:11
      <a href='/_s_/dyn/Log_getBrowserScript?href=null&n=-1'><b>Click for browser script</b></a>

So, Sahi can “find” the file as it doesn’t raise any error with a valid and existing file. But when the form is submitted, the file is never uploaded by the Sahi proxy.

Other checks:

  • I removed the client side HTML5 and JavaScript validation to be sure there is no side effect.
  • All my other Sahi tests are Ok, only the 3 with an Upload don’t pass
  • The proxy is set in my testing browser
  • I can open the Sahi controller in the browser without problem
  • Same problem on MaxOsX and Ubuntu
  • Each time I run an upload test, I’ve got a new entry in /userdata/temp/download named like sahi_11a83f8806be8046fc0aaa80eac076110b95__fr-fr-2-0.bdic

What is really weird, is that I am sure that those tests passed some times ago, something must have changed in my application or configuration that breaks the Sahi file upload but I can’t find what.
And before in the Sahi console I had logs about the files that it was uploading, now there is no log at all.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T21:57:06+00:00Added an answer on June 18, 2026 at 9:57 pm

    Is the url to which the form is posted different from the url of the web page? _setFile and _setFile2 take a third parameter which can be configured to point to the action URL (the url to which the file should be attached by the Sahi Proxy) http://sahi.co.in/w/_setFile

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using intellij and maven pom files, how do i debug tests run inside the
Using C# How can I show a document in richtextbox without scrollbars, But I
My question is related with the tests for some application in Symfony2. I use
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
Using Yii MVC, I want to know when a user is still on my
Using Trigger.io's barcode api in an application that only contains boilerplate HTML and the
TL;DR : In a Behat+Mink ( @javascript w/ Sahi) scenario, Sahi enter some text
Using Tsql, how can I find out when MS SQL server was installed?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.