Importing an external custom Library in Robot framework

544 views
Skip to first unread message

Neel Desai

unread,
Jul 20, 2017, 8:24:50 PM7/20/17
to robotframework-users
Hello All,

I have project called "sampleJavaDoc" and inside that I have one class called DocSample in a package com.here.cmeQA.sampleJavaDoc .It has only one method in it called "workflow" and there is no main method in this project. So I have created a standalone jar file from that project "customLibrary." 

package com.here.cmeQA.sampleJavaDoc;

public class DocSample {

public void workflow() {
System.out.println("Jay Bahuchar Mataji!!!Execution is done");
}
}


Now, my second automation project called "MainProject". Inside that I have test case file "testcases.txt" created using RF(robot framework). Now I am trying to import my custom library into this test case file, so I am just writing one statement "Library    customLibrary" and test case file look like following:

*** Settings ***
Documentation  A resource file containing the application specific keywords
Library String
Library com.here.cmeQA.sampleJavaDoc.DocSample

*** Test Cases  ***
Test Case:1
      GIVEN workflow
      WHEN workflow
      THEN workflow

Now workflow is a keyword(as a method) in my "customLibrary". Whenever I am trying to execute this test case file, it is not able to find the keyword "GIVEN workflow" basically "workflow"  because as we know that robotframework ignores GIVEN,WHEN, THEN,....

Can any one guide me what I am doing wrong over here? Am I importing in wrong way? Is there any other way to import external custom library?

Thanks,

Pekka Klärck

unread,
Jul 29, 2017, 7:31:09 AM7/29/17
to Neel Desai, robotframework-users
Hi,

Do you get any errors importing the library? My guess is that the
library is not found.

Cheers,
.peke
> --
> You received this message because you are subscribed to the Google Groups
> "robotframework-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to robotframework-u...@googlegroups.com.
> To post to this group, send email to robotframe...@googlegroups.com.
> Visit this group at https://groups.google.com/group/robotframework-users.
> For more options, visit https://groups.google.com/d/optout.



--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org
Reply all
Reply to author
Forward
0 new messages