Topic
  • 3 replies
  • Latest Post - ‏2012-12-12T17:43:55Z by SystemAdmin
SystemAdmin
SystemAdmin
16727 Posts

Pinned topic How to doubleclick particular cell in java swing table?

‏2012-12-10T10:11:36Z |
Hi,

I want to double click the cell in the java swing table and then needs to enter the value in the cell.When I record,cell is identified as x,y co ordinates and when playback it is not identified properly.

Attached TableScreenshot.

Can anyone pls help me to resolve this?
Updated on 2012-12-12T17:43:55Z at 2012-12-12T17:43:55Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    16727 Posts

    Re: How to doubleclick particular cell in java swing table?

    ‏2012-12-11T16:00:37Z  
    The recording on the Java Swing Table cell created atCell based method for me and I used doubleClick and inputChars API to edit in a particular cell

    swingSet().click(atPoint(425,22));
    // TabbedPage
    tableView().click(atText("TableView"));

    jTable().click(atCell(atRow("Favorite Color", "0, 255, 0", "Favorite Number", "838"), atColumn("Last Name")), atPoint(76,12));
    • jTable().doubleClick(atCell(atRow("Favorite Color", "0, 255, 0", "Favorite Number", "838"),atColumn("Last Name")), atPoint(76,12));*
    • swingSet().inputChars("mm");*
    jTable().click(atCell(atRow("Favorite Color", "255, 0, 255", "Favorite Number", "8"),atColumn("Last Name")),atPoint(73,12));

    I tried it on Win 7 64 bit machine, RFT 8.3 version and Sun JRE 1.6
  • SystemAdmin
    SystemAdmin
    16727 Posts

    Re: How to doubleclick particular cell in java swing table?

    ‏2012-12-12T06:05:39Z  
    The recording on the Java Swing Table cell created atCell based method for me and I used doubleClick and inputChars API to edit in a particular cell

    swingSet().click(atPoint(425,22));
    // TabbedPage
    tableView().click(atText("TableView"));

    jTable().click(atCell(atRow("Favorite Color", "0, 255, 0", "Favorite Number", "838"), atColumn("Last Name")), atPoint(76,12));
    • jTable().doubleClick(atCell(atRow("Favorite Color", "0, 255, 0", "Favorite Number", "838"),atColumn("Last Name")), atPoint(76,12));*
    • swingSet().inputChars("mm");*
    jTable().click(atCell(atRow("Favorite Color", "255, 0, 255", "Favorite Number", "8"),atColumn("Last Name")),atPoint(73,12));

    I tried it on Win 7 64 bit machine, RFT 8.3 version and Sun JRE 1.6
    Hi NitnSharma,

    Thank you so much for your reply.I am using the below code for clicking the cell and getting UnspportedSubitem exception.

    Index in = new Index(2);
    Index in1 = new Index(1);
    Row ro = new Row(in1);
    Column col = new Column(in);
    Subitem sub=new Cell(ro,col);
    tabletable().click(sub);
    While recording getting the below code:
    tabletable().click(atPoint(85,54));
    But when we run,cell is not identified properly and clicking somewhere else.
    Attached screenshot contains code,exception and script explorer.

    My entire automation depends on this test case.
    Please help me to resolve this.

    Thanks,
    Jayaprakasam.R
  • SystemAdmin
    SystemAdmin
    16727 Posts

    Re: How to doubleclick particular cell in java swing table?

    ‏2012-12-12T17:43:55Z  
    Hi NitnSharma,

    Thank you so much for your reply.I am using the below code for clicking the cell and getting UnspportedSubitem exception.

    Index in = new Index(2);
    Index in1 = new Index(1);
    Row ro = new Row(in1);
    Column col = new Column(in);
    Subitem sub=new Cell(ro,col);
    tabletable().click(sub);
    While recording getting the below code:
    tabletable().click(atPoint(85,54));
    But when we run,cell is not identified properly and clicking somewhere else.
    Attached screenshot contains code,exception and script explorer.

    My entire automation depends on this test case.
    Please help me to resolve this.

    Thanks,
    Jayaprakasam.R
    Your application is getting recognised as Windows instead of Java. Please check that your Java is enabled properly.

    Below links should help you with enabling the Java used to run the swing application.

    http://publib.boulder.ibm.com/infocenter/rfthelp/v8r2/index.jsp?topic=%2Fcom.ibm.rational.test.ft.doc%2Ftopics%2FRunJavaEnabler.html
    http://publib.boulder.ibm.com/infocenter/rfthelp/v8r2/topic/com.ibm.rational.test.ft.doc/topics/ConfiguringYourJREs.html
    http://publib.boulder.ibm.com/infocenter/rfthelp/v8r2/topic/com.ibm.rational.test.ft.doc/topics/JREsTabDB.html