Not able to run example testscript

Asked by fagunbhavsar

Hi,

I am new to Automation so pardon my ignorance. Currently, I am using Ubuntu 12.04.02, have installed Python and SST version 0.2.3 . Whenever I try to run example testscript (as given on https://pypi.python.org/pypi/sst/0.2.3), it throws an error as shown in snapshot:

http://snag.gy/FSCEo.jpg

Apart from this, when I saved this example in .py file and tried to run from command line with "sst-run <name>.py", it did started SST, but firefox did not get opened after this (no error message showed up).

Please help!

Thanks a lot in advance.

Regards,
Fagun

Question information

Language:
English Edit question
Status:
Solved
For:
selenium-simple-test Edit question
Assignee:
No assignee Edit question
Solved by:
Corey Goldberg
Solved:
Last query:
Last reply:
Revision history for this message
Best Corey Goldberg (coreygoldberg) said :
#1

> it throws an error as shown in snapshot

you are trying to use it from the Python shell. It's not designed to be run in that way. Perhaps that should be made more explicit in the examples/documentation. You should use `sst-run` from the command line to run your tests (with your source code in a .py file, or many tests across many .py files).

> tried to run from command line with "sst-run <name>.py"

ah, you were so close :)
notice the note in the docs: "you don't add the .py extension to your test invocation" and check the example a little closer.

so, if your test's source file is `foo.py`, just invoke `sst-run foo` to run it, not `sst-run foo.py`.

Also, there will be a new (0.2.4) release coming very soon (hopefully today). It will include updated features for discovering/loading tests, which are useful if you have larger/complex test suites. Included in the release is updated documentation showing more advanced techniques for selecting tests. See the section: "Selecting tests to run" in the new documentation at: http://testutils.org/sst/ once the release is out.

hope that helps,
-Corey

Revision history for this message
fagunbhavsar (fagun-bhavsar) said :
#2

Thanks a lot for the reply.

Well, it was a problem with file path, which I did not set earlier. Now, I rectified it so it's working fine. Thanks again!

Revision history for this message
fagunbhavsar (fagun-bhavsar) said :
#3

Thanks Corey Goldberg, that solved my question.

Revision history for this message
Bodea Marius (bodeamariuscosmin) said :
#4

I encounter a problem when I want to run some SST scripts.

So, firstly, let me please explain the problem. I am using Windows 7 and from Command Prompt I want to run a python file. I first use the source of the SST module which is in my Python27 folder. After that I enter the " sst-run -d " command followed by the path of the folder where my test is C:\Python27\Lib\site-packages\sst-0.2.4-py2.7.egg\teste . This is the entire command I enter: C:\Python27\Lib\site-packages\sst-0.2.4-py2.7.egg\sst>sst-run -d C:\Python27\Lib\site-packages\sst-0.2.4-py2.7.egg\teste . I get this result http://puu.sh/8Bm7o.png and the browser is opening but just a blank page and in about 1 second it shuts down.

Can you please help me to solve this issue?

Thank you in advance!

Best regards,
Marius

Revision history for this message
Corey Goldberg (coreygoldberg) said :
#5

Marius,
please don't hijack old answered questions... you can ask new questions.

I'm not sure why you are trying to run from within site-packages (did you install the sst module)?

please try running an individual test of your own. What are the results?

regards,
-Corey

Revision history for this message
Bodea Marius (bodeamariuscosmin) said :
#6

I am really sorry for hijacking, I did not really mean to, so please accept my apologies.
I am new to SST or Python and I am desperateto make this thing work.
I have installed the sst using easy-install sst on my cmd. If I open the cmd and simply use sst-run test_name I get an Error 5 Access is denied.
Can you give me exaclty the path to use to make a test work?

Thank you and sorry again!