Showing posts from January, 2017

Best practises - Selenium WebDriver/ Java

Intermittent failure in Selenium Test cases ? After clicking the drill down sometimes web-elements are not found causing all summary table test cases to fail. Common Root Causes 1) Prefer Selection By.ID className  then By.cssSelectior and only if all else fails use By.Xpath Selection by CSS By.CSSSelector should be preferred over XPath as this is more stable as it is natively supported by browser . XPAth is an abstraction provided by Selenium and not as performant. If XPath is used make sure that you have hand written the XPath and it is performant and not generic in that it has to to brute force search through the entire DOM to find your element. Where ever possible , use By.ID, else By.CSSSelector and in case of no other option use XPath after proper testing. You can use FireFinder plugin for FireFox (first add FireBug) to test your CSS or Xpath (if there is no way you can select by CSS) For example this XPath to finding the drill down element  //*[@id='scTableTest_Site-PLMN-PL…

Python Profiling - Some hints

No time to compose fully; Here are some links which helped me in CPU profiling

Python Profilers

 python -m cProfile -o profile_out

 pacman -S kdesdk-kcachegrind


 pstats dechipering cprofile output


 pyprof2calltree -k -i myscript.cprof

 performance tips python