About sp2hari

I'm the Co-Founder of Interviewstreet.com.

Finally 10….

Ok, i am certainly not talking anything about my GPA. After fighting (fighting is an understatement i suppose) with Firefox and LDTP for 3 hours (well this is actually few days), finally managed to get 10 test cases work properly.

At least these 10 test cases will work properly for integration with Tinderbox. Have to send these test cases to emily soon and get them integrated with tinderbox.

The output log is
<ldtp>
<group name=”group1″>
<script name=”verifyaddressfield.py”>
<test name=”address field and go button”>
<pass>1</pass>
</test>
</script>
<script name=”verifybackforward.py”>
<test name=”Back and Forward buttons”>
<pass>1</pass>
</test>
</script>
<script name=”verifyhome.py”>
<test name=”verify home button”>
<pass>1</pass>
</test>
</script>
<script name=”verifynewtab.py”>
<test name=”Open a new tab “>
<pass>1</pass>
</test>
</script>
<script name=”verifyyahoo.py”>
<test name=”topsite – yahoo”>
<pass>1</pass>
</test>
</script>
<script name=”verifymsn.py”>
<test name=”topsite – msn test”>
<pass>1</pass>
</test>
</script>
<script name=”verifyamazon.py”>
<test name=”topsite – amazon”>
<pass>1</pass>
</test>
</script>
<script name=”verifyftp.py”>
<test name=”navigate ftp”>
<pass>1</pass>
</test>
</script>
<script name=”verifysearch.py”>
<test name=”Open search by keyboard shortcuts”>
<pass>1</pass>
</test>
</script>
<script name=”verifyfindinpage.py”>
<test name=”Find in Page”>
<pass>1</pass>
</test>
</script>
<timeinfo start=”03:23:00 AM on 18-Jun-2007″ elapsed=”0:1:8″></timeinfo>
<groupsstatus total=”10″ pass=”10″ fail=”0″></groupsstatus>
</group>
</ldtp>

Well looks like i have underestimated how bugs can trouble a poor coder like me :P.

Each test case has its unique problem :P.
The major problem is the Firefox crash :(. Though the test case work individually, Firefox crashes if all the test cases were run under a single runner xml :-(. I have downloaded Firefox firefox-3.0a6pre now ( was using firefox-3.0a5pre all these days). Hopefully Firefox 6 is stable against the test cases :-).

Anyway the 10 is not the final list. I am supposed to test 30 test cases properly for the Functionality subgroup of smoketests testgroup for Firefox 3.0. Not to mention about the lots and lots of test cases from other test groups.

Let me post the issues i am facing with the other test cases, so that it is easier for me to fix them later.

Before that, the 10 test cases which worked in my favour are :)

3954: Address Field and Go button
4032: Back and Forward buttons
4031: Home button
4086: Open a new tab
3955: Top Site – Yahoo
3956: Top Site – MSN
3957: Top Site – Amazon
3959: Navigate FTP
4245: Open search by keyboard shortcuts
3967: Find in Page

The test cases having issues are
1. 4137: Add an RSS feed/Livemark
This is the strangest test case i have ever found :(. This doesn’t work for the first time. Next time without any modification, if i run the test case it works like properly. Third time it is not working and fourth time it again works properly . Well, that is more than enough for me, i either end up banging the computer monitor or beating myself that there is no 5 th time :-(. Should check this test case properly.

Looks like this is the only test case which troubles me as of now. Have the rest of the code ready but looks like new problems are starting soon. For the same runner xml, same files , same Firefox, test case 2 shows come error. Have to check that soon. Got firefox-3.0a6pre few mins back. Have to run the test cases with that.

And yes, tried something with the list not getting selected problem. Even nags confirmed this problem some time back and finally able to find out the exact line where the error occurs .

if (AccessibleSelection_selectChild (selection, text_index)) { }
That is line 110 from list.c. The if statement is returning false ending up in “LDTP_ERROR_UNABLE_TO_SELECT_CHILD” . Hoping to fix this soon. Will be really happy if i fix this one as i will be able to add something to the ldtp source code. Been a long time since my name appeared in the Changelog ;-) ;-)

Only thing i am happy about is both Ubuntu Linux and Solaris responds similarly for the test cases. So no separate Firefox issues and Solaris issues as of now. Let us see how this proceeds.

Another small issue.
Whenever i get any error in any of the test cases, i get the following error
<script name=”verifyamazon.py”>
<test name=”topsite – amazon”>
<ERROR>Traceback (most recent call last):
File “/usr/local/bin/ldtprunner”, line 407, in executescript
execfile (scriptname, scriptglobal)
File “verifyamazon.py”, line 52, in <module>
log (msg, ‘error’)
File “/usr/local/lib/python2.5/site-packages/ldtp.py”, line 2500, in log
logger.error (message)
File “logging/__init__.py”, line 1015, in error
File “logging/__init__.py”, line 1100, in _log
File “/usr/local/lib/python2.5/site-packages/ldtp.py”, line 2421, in makeRecord
return LdtpLogRecord (name, level, fn, lno, msg, args, exc_info)
File “/usr/local/lib/python2.5/site-packages/ldtp.py”, line 2394, in __init__
msg = ‘<’ + logging.getLevelName (level) +’>’ + saxutils.escape (msg) + ‘</’ + logging.getLevelName (level) + ‘>’
File “/usr/lib/python2.5/site-packages/_xmlplus/sax/saxutils.py”, line 31, in escape
data = data.replace(“&”, “&amp;”)
AttributeError: ‘LdtpExecutionError’ object has no attribute ‘replace’
</ERROR>
</script>

I am giving the error message properly in the try block, but not in the except block. When i give the error in the except block then i get the error message in the log file properly. But i am supposed to pass the error message from the try block to the except block. Should learn a bit of python exceptions to know more about this

Anyway the files for the test cases which are working can be obtained from here

Note :: Have added many more test cases to the above file now, but didn’t like to change the title.

Meet GNU/Linux 07

After 2 successful editions of Meet GNU/Linux, which is conducted by
GLUG-T every year for beginners, the third edition of MGL is starting
on 27th July, at NITT.

A few updates about MGL’07 :

1. Guys are planning to release a beginner handbook, which would be
given out to them. The content is being edited in a wiki :
http://glugt-mgl.pbwiki.com/ Go ahead and edit when you are free.

2. This is GNU/Linux for dummies. So, if you have any of your
friend/relative interested in learning about it(in trichy), you can
ask them to contact suren who is co-ordinating
the event.

3. The co-ords are planning to release podcasts of the events, which
will be helpful.

Ideas, suggestion about how to organise the classes are welcome!

Comments :)

How many comments have you seen for a single blog ?

Well, when i asked taggy (the internet guru of NITT) he replied around 10-20. Suren has seen around 50 for a he-she blog.

But this one is amazing. A single blog (in fact a single line blog) getting around 268 comments (and still counting).

Reminds me that “What you say is more important than how much you say”.

Topping google search

I attended the podworks.in last weekend. For those who don’t know what podworks is , PodWorks.in is a 2-day workshop styled unconference dedicated to the sharing of knowledge around audio and video podcasting. It’s a successor to the extremely successful BlogCamp that was held last year.

Though i have lots and lots to say about the event, one strange and nice thing is that if you google for podworks.in my blog tops the list :-) :-)

Internet from solaris …

DNS makes our life real easy. Without that, i don’t think people will say check out http://google.com but check out http://64.233.187.99. I realized how important DNS is to us and without DNS how one can go mad.

I installed Solaris (Neveda ) two weeks back and it was good. :-) . Though i was a bit scared in the initial stages, i didn’t find much difference between Linux and Solaris as far as LDTP is concerned. Anyway i had Emily Chen from Sun China (my Soc Mentor ) to help me with the issues and many thanks to her, she was always willing to help me in any issue. In fact almost all her mails had something saying
” I am on Gtalk almost every workday, feel free to ping me when you have problems. ” or something similar to that :-) :-)

But there was one issue which really troubled me in Solaris and that was DNS wasn’t working. Instead of typing http://www.google.com, i had to type http://64.233.187.99/ :(

I had a huge list of servers which i might use and their ip’s . (Many thanks to dnsstuff.com). I was getting more and more frust typing IP’s instead of url’s and browsing only the cached page instead of the actual pages. I tried many a things and even Emily also helped me with few tips and tricks. But things never worked. I was really getting irritated as this was delaying my progress in SOC.

Determined to solve the issue somehow, i started trying all the options in the Network Settings. One strange thing i noted is that, whenever i add a DNS server and close it, next time i open Network Settings, the entries won’t be there. Simply disappeared from there :-(.

I noticed an option called Location in the Network Settings. It was empty and i wasn’t sure whether i have seen anything like this in Linux.


Not sure of what to do with that Location, i gave “home” there. I wasn’t sure whether this will solve my problem, but no harm in trying. But once i restarted network, www.google.com worked.
YES. IT WORKED. IT WORKED .IT WORKED. IT WORKED .IT WORKED. IT WORKED

I am pretty sure anyone who had seen me at that time would have thought that i am mad. Even i wont blame them . I accept, suddenly jumping out of the chair and shouting “IT WORKED” at 3 in the morning is quite odd. :P

Anyways, now that things have started working, will be saying my “Hello World” to tinderbox soon :-)

Running a test case …

Having written the test scripts for Firefox, this time going to tell how to test Firefox with these scripts. The test scripts can be found here

There is a wiki page in LDTP website which gives quick tips about how to run LDTP test cases.

First quick steps to get LDTP installed . If you have LDTP already installed, then you can skip this.

Installation
Get the source/binary from the downloads section of LDTP web page. Any other dependencies which LDTP might need while installation is libxml2 and libat-spi. (I generally install the debug and dev packages of the above two). After this installation of LDTP shouldn’t have any issues :-)

Runner XML
Runner XML files makes testing many test cases one after another in a batch mode easy. A sample runner XML can be found here. A very simple runner XML needed to run a single test case will be like

<ldtp>
<logfileoverwrite>1</logfileoverwrite>
<logfile>log.xml</logfile>
<group>
<script>
<name>verifyaddress-autocomplete.py</name>
<data>firefox.xml</data>
</script>
</group>
</ldtp>

The tags are self explanatory.
You can have any number of script blocks and thereby test any number of test cases one after another. The data tag is not necessary but it is better to have a separate data file.

Test
Well, that’s all you have to do. Start Firefox and then

hari@home:~$ ldtprunner run.xml

The above command starts testing the application with the test case provided in the run.xml .

Note :: It is also possible to test simply by giving

hari@home:~$ python verifyaddress-autocomplete.py

But i prefer doing it using runner XML, as that has more features.

There is a complete tutorial for LDTP here. This explains everything needed to write a test script clearly and is worth reading :)