[selenium-users] Uploaded files Issue

36 views
Skip to first unread message

shivani angra

unread,
Apr 21, 2010, 7:26:28 AM4/21/10
to Selenium Users
Hi,
I uploaded some files and record it in selenium IDE.
Application takes proper path on my machine but when that script is
running on developer's machine at that time script fails bacause of
change in file path.

Can any one suggest me how I can use selenium IDE script in this
operation.

Thanks

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

SiKing

unread,
Apr 21, 2010, 3:30:13 PM4/21/10
to Selenium Users
Here is something from a book that I am writing on Selenium.


It is sometimes desirable to use a different base URL for different
circumstances. For example,
you could have several different instances of your application under
test installed on the web
server, and have different clients test each of these different
instances.

Let's say that our web server is test_server.com, and each of the
instances are installed at
instance1, instance2, and so on. Unfortunately, the Test Runner HTA
ignores the baseURL
parameter that is passed to it. To get around this, I have something
like the following .bat
script start a test run.

rem Somehow decide how the different clients will be distinguished
from each
rem other. Based on that, define a variable called baseURL.
Alternatively set
this
rem variable by hand for each client. Don't forget the trailing slash.
set baseURL=http://test_server.com/instance1/
rem Next, write the variable to a file, that has JavaScript syntax.
echo baseURL = "%baseURL%"; > baseURL.js
rem Lastly start the tests, as disucssed in previous chapter.
set SELENIUM_HOME=%USERPROFILE%\Selenium
set ARGUMENTS=test=file:///%SELENIUM_HOME
%\tests\GoogleTestSuite.html^&auto=true
"%SELENIUM_HOME%\seleniumcore1.0.1\
core\TestRunner.hta" "%ARGUMENTS%"

You will have to make sure that each of your tests contains the
following code. This will have to
be added by hand; Selenium has no automatic way of adding something
like this.

<HEAD>
<SCRIPT LANGUAGE="javascript" SRC="baseURL.js"></SCRIPT>
</HEAD>

After this, inside the tests, you can open this location by going:

<tr>
<td>store</td>
<td><SCRIPT
LANGUAGE="javascript">document.writeln(baseURL);</SCRIPT></td>
<td>baseURL</td>
</tr>
<tr>
<td>open</td>
<td>${baseURL}Login</td>
<td></td>
</tr>

Using this technique, it is possible to pass information into each of
the tests from the calling
environment.

shivani angra

unread,
Apr 22, 2010, 6:57:56 AM4/22/10
to Selenium Users

Hi,
Thanks for reply.I am using selenium IDE in HTML and i don't
know where this code will added. Please define the behavior so that it
could be easy to implement this.

Deepak Koul

unread,
Apr 22, 2010, 7:12:15 AM4/22/10
to seleniu...@googlegroups.com
Put your files in a Webserver directory, so that path remains portable.



Chat Google Talk: kouldeep
Contact Me LinkedinFacebookTwitter

Gustavo G. Martinelli

unread,
Apr 22, 2010, 10:12:54 AM4/22/10
to seleniu...@googlegroups.com
Hi,  everyone know hot to make uploading file with Selenium - RC with IExplore 8, 7.
Thanks.

--
Grateful,
Gustavo G. Martinelli
Tel:(61)8189-3451
Reply all
Reply to author
Forward
0 new messages