My other blog (in Hungarian) merhetetlen.blogspot.com

Thursday 25 April 2013

Flashbacks

    It is always good if you station in a peaceful quadrant of the galaxy. No annoying battles with the Rebels, you do not need to wear your white helmet with you cannot breath... but sometimes even here, you have to jump back to the front line and fight.

    So what's happened? I had to test web GUI again after 1 year of peaceful API testing. It was not a usual test, it was more simple, I just had to load a few page a few times... you cannot wish an easier task to do...

Good old problems I have faced with:
  • a page just does not work in HtmlUnit, there is a meaningless JS exception in the log and it is impossible to figure out what went wrong and where and why. And of course everything works perfectly in a real browser (=slow, slow, slow)
  • So you have to use a real browser, but:
    • you cannot set any cookie you want. Why? Because not! Details? An average user could not do it as well... thanks! This is not an average user emulator, but a testing framework, please! That's the reason why you cannot get response status codes, delete the cache (not sure...) and other useless, unwanted features
    • you cannot use the domain and the expiration date even if you are on that page. It only works with name=value... no comment
    • Chrome hangs on loading page A Firefox will hang for sure on page B... so you cannot use any of them without hacking...
    • You set the pageloadtimeout and realize it is not supported by Chrome. No it is not important at all... the default 2 eons is absolutely fine. But do not worry, you can use a plugin in Chrome which does the same, but:
      • you cannot get the crx file.... 
        • well you can get it but it will take you a while, it is not easy to find at all, and you have to be fast and spend a lot of time to figure out how can you get it
      • finally you get it and realize --load-extension does not like it, so at the end the folder what was always there is enough... no worries I am paid by time...
So it is fun.... pure fun. But anyway, what I can suggest to you is never test a well-written site in HtmlUnit, using all the features of it, like listeners and the Emperor  knows what else (it was long ago, in a faraway....), and you would never think that should be a standard for a web test framework.... 

...but for the Force sake, if your test framework does not come with AI and it is not enough to show the site to it and tell a few things what it should listen on, do not block our access to the internals. This is our profession we know what we want to do and why... at least me and my imaginary friends

No comments:

Post a Comment