• 3 replies
  • Latest Post - ‏2013-10-22T07:54:55Z by OttoDiesel
4 Posts

Pinned topic Use RFT from a Java Application

‏2013-10-21T07:23:08Z |

Good morning,

I've created a new Java Project and added a new Class to it called "Test" with following code:





public classTest {

public static void main(String[] args) {

DomainTestObject[] domains = RationalTestScript.getDomains();

System.out.println("domains: " + domains.length);




But when i run the application (as a Java Application) i get following exception:

Exception in thread "main" com.rational.test.ft.sys.Transaction$NotInTransactionException

I also tried "com.rational.test.ft.sys.Transaction.begin();" at the beginning of the main method, but then I get another exception:

Exception in thread "main" java.lang.Error: only a client test context can begin a transaction


Can anybody help me?

FYI: If I run the exactly same code in a RFT project, I get no exception and the console successfully prints the length of the domain array.

Regards MightyM

Updated on 2013-10-21T07:24:11Z at 2013-10-21T07:24:11Z by MightyM
  • cagin.uludamar
    66 Posts

    Re: Use RFT from a Java Application


    Why are you trying to get domains from a Java app?

  • MightyM
    4 Posts

    Re: Use RFT from a Java Application


    Because I finally want to control RFT from JBehave and not reversed. So I thought I start trying to implment RFT in a simple Java Application. The getDomains command is just for trying out whether I can use RFT from a Java application.


  • OttoDiesel
    51 Posts

    Re: Use RFT from a Java Application


    I posted a possible solution a few minutes ago in this thread: