Wednesday, 5 November 2014

PhantomJS Test






  • PhantomJS is a Headless Webkit with JavaScript API.
  • Created by Ariya Hidayat
  • PhantomJS is not a testing framework, used to launch tests
  • It has fast & native support for various Web Standards: DOM handling, CSS selector, JSON, canvas and SVG.  
  • GhostDriver is a Webdriver wire protocol in simple JS for PhantomJS.  
  •  PhantomJS is used for Headless Testing of Web Applications that comes with in-built GhostDriver, rendered web pages never displayed 
  • Can be used with different test frameworks Jasmin, Capayra , Robot Framework etc..
  • Ideal for CI systems , AmazonEC2,...
  • Very easy to install 

Installation:

Download from this link

Unzip zip file

Set path from Environment Variables

Write some code js code



From command line go to js file directory
                          
                                          




Monday, 13 October 2014

Firefox User-agent

You can find your agent from www.useragentstring.com

firefox :



chrome :






Jenkins Different Port




Use the following command at command prompt:

java -jar jenkins.war --httpPort=9090
 
If you want to use https use the following command:

java -jar jenkins.war --httpsPort=9090

Tuesday, 7 October 2014

Between Rest & SOAP

 
 
 
 
 
 
1) REST is more simple and easy to use than SOAP
2) REST uses HTTP protocol for producing or consuming web services while SOAP uses XML.
3) REST is lightweight as compared to SOAP and preferred choice in mobile devices and PDA's.
4) REST supports different format like text, JSON and XML while SOAP only support XML.
5) REST web services call can be cached to improve performance.

Wednesday, 10 September 2014

Hamcrest ?

- Hamcrest is a set of matchers framework for writing matcher objects
- Hamcrest is integrated into JUnit
- Instead of using JUnit’s assertEquals methods, we use Hamcrest’s assert



The following list contains the most important Hamcrest matchers.
  • is - decorator to improve readability
  • allOf - matches if all matchers match (short circuits)
  • anyOf - matches if any matchers match (short circuits)
  • not - matches if the wrapped matcher doesn't match and vice versa
  • equalTo - test object equality using Object.equals
  • hasToString - test Object.toString
  • instanceOf, isCompatibleType - test type
  • notNullValue, nullValue - test for null
  • sameInstance - test object identity
  • hasEntry, hasKey, hasValue - test a map contains an entry, key or value
  • hasItem, hasItems - test a collection contains elements
  • hasItemInArray - test an array contains an element
  • closeTo - test floating point values are close to a given value
  • greaterThan, greaterThanOrEqualTo, lessThan, lessThanOrEqualTo - test ordering
  • equalToIgnoringCase - test string equality ignoring case
  • equalToIgnoringWhiteSpace - test string equality ignoring differences in runs of whitespace
  • containsString, endsWith, startsWith - test string matching
 
 The following assertions are all equivalent: 
 
assertThat(theBiscuit, equalTo(myBiscuit));
assertThat(theBiscuit, is(equalTo(myBiscuit)));
assertThat(theBiscuit, is(myBiscuit));
 
 
 
 

Tuesday, 9 September 2014

Chrome Certificate Problem --ignore-certificate-errors

 DesiredCapabilities capabilities = DesiredCapabilities.chrome();  
                  capabilities.setCapability("chrome.switches", Arrays.asList("--incognito"));  
                  ChromeOptions options = new ChromeOptions();  
                  options.addArguments("--test-type");  
                  capabilities.setCapability("chrome.binary", "C://webdrivers//chromedriver//chromedriver.exe");  
                  capabilities.setCapability(ChromeOptions.CAPABILITY, options);  
                  driver = new ChromeDriver(capabilities);  


This code fix your problem

Have nice day