Wednesday, January 31, 2018

version one api to get the Test case details using Test Case ID http://Your_Version_ONE_URI/rest-1.v1/Data/Test?where=Number="AT-57708"Where, Your_Version_ONE_URI looks like below :--> https://www3.v1host.com/DieHardTechyNOTE:

To call the above api from postman you need to use basic authentication with your version one username and password.

If AT-57708 id exists in Version one , Above API gives the XML response containing details about that Test case.

is not a right approach. Because this is layman way of asserting absence of web element.As per selenium documantaion, best way to check if element is not present is using findElements and then asseting on the size of the list returned. findElements does not throw any exception in case if an element is not present. Asserting on 0 length is more appropriate for absence of an element. Selenium official comment :

Wednesday, April 19, 2017

One of the most common problem when using annotation is to find the classes based upon the attribute value of an annotation. Problem-statement: Find all the classes in com.annot package which have @ExampleAnnot annotation and attribute value of author in @ExampleAnnot is dht.To achieve this we will need the following jars.1. javassist-3.12.1.GA.jar which can be Download from here.2. org.reflections.0.9.11.jar which can be Download from hereAdd both the jar files in your classpath. Example code:

The above example first finds all the classes with @ExampleAnnot annotation, then sequentially checks the author attribute from @ExampleAnnot of each class , and if author value is equal to dht, it prints the well qualified name of all those class.Above example returns all the classes which have author name as dht.

LDAP authentication is now-a-days very useful for enterprises application. LDAP also acts as source of SSO [Single sign on]. Ldap stands for Lightweight Directory Access Protocol , in this post we are basically trying to authenticate an user using his windows credentials with Java.

Prerequisite :1. Java version 1.7 or higher2. Springs 3. You need to know your organizations LDAP url ,port number , username and password of manager account or service account.Spring provides LDAP template which we can use for easy querying of LDAP server.Below is the example code of LDAP authentication:

Tuesday, April 18, 2017

java.lang.AbstractMethodError: org.testng.remote.RemoteTestNG$DelegatingTestRunnerFactory.newTestRunner(Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;Ljava/util/Collection;)Lorg/testng/TestRunner;
at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:587)
at org.testng.SuiteRunner.init(SuiteRunner.java:161)
at org.testng.SuiteRunner.<init>(SuiteRunner.java:114)
at org.testng.TestNG.createSuiteRunner(TestNG.java:1290)
at org.testng.TestNG.createSuiteRunners(TestNG.java:1277)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1131)
at org.testng.TestNG.run(TestNG.java:1048)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:207)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:178)

error ?This is one of the common issue people face when running testng suites. Most common reason is conflicting of testng versions. May be there are 2 versions of testng in your classpath , which are causing this issue.Check your maven dependency from Build path[Right click on project-->Build Path -->Configure build path --> Maven dependency and check for testng]if there are 2 version of testng, delete one. This should solve your problem.If you get stuck somewhere, contact us here : Email