Topic
  • 8 replies
  • Latest Post - ‏2012-06-21T01:01:03Z by prashant_RPT
prashant_RPT
prashant_RPT
45 Posts

Pinned topic How to put verification point on column name

‏2012-05-01T05:52:10Z |
Hi,

I want to put a condition/verification point on column availability/unavailability.

find attached screenshot of the tabel on which i want to put a condition on column name.
condition : i have to check that satisfied column name should be available.
how can i puct this in verification point or using coding sugesst me wither way..
Thanks in advance
prashant
Updated on 2012-06-21T01:01:03Z at 2012-06-21T01:01:03Z by prashant_RPT
  • SystemAdmin
    SystemAdmin
    16727 Posts

    Re: How to put verification point on column name

    ‏2012-05-07T12:01:22Z  
    Hi,

    you can use "try - catch" block - for example

    try {
        //tested column is visible
        //give verification point
    } catch (Exception e) {
        //tested column is not visible
        logError (e.getMessage());
    }
    


    Best Regards,

    Jiri
    Updated on 2014-03-25T13:02:45Z at 2014-03-25T13:02:45Z by iron-man
  • prashant_RPT
    prashant_RPT
    45 Posts

    Re: How to put verification point on column name

    ‏2012-05-09T17:12:10Z  
    http://books.google.co.in/books?id=N3Yg5HlQXioC&pg=PA93&lpg=PA93&dq=rational+functional+tester+time+estimation+for+writing+a+scripting&source=bl&ots=NgX2JgKllY&sig=XJu89i8NxW_Ieu7mOcn68Hd35bM&hl=en&sa=X&ei=ZaSqT7v3E87jrAf3rfHVAQ&ved=0CFkQ6AEwAw#v=onepage&q=rational%20functional%20tester%20time%20estimation%20for%20writing%20a%20scripting&f=falsev
  • prashant_RPT
    prashant_RPT
    45 Posts

    Re: How to put verification point on column name

    ‏2012-05-09T17:13:45Z  
    http://books.google.co.in/books?id=N3Yg5HlQXioC&pg=PA93&lpg=PA93&dq=rational+functional+tester+time+estimation+for+writing+a+scripting&source=bl&ots=NgX2JgKllY&sig=XJu89i8NxW_Ieu7mOcn68Hd35bM&hl=en&sa=X&ei=ZaSqT7v3E87jrAf3rfHVAQ&ved=0CFkQ6AEwAw#v=onepage&q=rational%20functional%20tester%20time%20estimation%20for%20writing%20a%20scripting&f=falsev
    http://www.dijohn-ic.com/test_automation_roi.pdfv
  • prashant_RPT
    prashant_RPT
    45 Posts

    Re: How to put verification point on column name

    ‏2012-05-09T17:14:54Z  
    http://www.dijohn-ic.com/test_automation_roi.pdfv
    http://www.stepinforum.org/stepinsummit2007/docs/RelQ%20-%20Automation%20For%20HigherTest%20Productivity.pdf
  • prashant_RPT
    prashant_RPT
    45 Posts

    Re: How to put verification point on column name

    ‏2012-05-28T11:51:18Z  
    Use this:
    ITestDataTable t=(ITestDataTable)table_htmlTable_name.getTestData("grid");

    or
    ITestDataTable t=(ITestDataTable)table_htmlTable_name.getTestData("contents");

    for(int i=0;i<t.getRowCount();i++)
    {
    for(int j=0;j<t.getColumnCount();j++)
    {

    logInfo("" +t.getCell(i,j));
    }
    }
    for Clicking Cell value:
    table_avatable().click(atCell(atRow(i), atColumn(j)));
    Clicking any button with any specific property:
    if("Button Caption Name".equals(link_Name().getProperty(".title")))
    {
    sleep(3);
    button_escalatesubmit_TL().click();
    System.out.println("Testing ");
    }
    else
    {
    button_escalatesubmit_TL().click(atPoint(918, 698));
    }
  • prashant_RPT
    prashant_RPT
    45 Posts

    Re: How to put verification point on column name

    ‏2012-06-09T11:30:34Z  
    Use this:
    ITestDataTable t=(ITestDataTable)table_htmlTable_name.getTestData("grid");

    or
    ITestDataTable t=(ITestDataTable)table_htmlTable_name.getTestData("contents");

    for(int i=0;i<t.getRowCount();i++)
    {
    for(int j=0;j<t.getColumnCount();j++)
    {

    logInfo("" +t.getCell(i,j));
    }
    }
    for Clicking Cell value:
    table_avatable().click(atCell(atRow(i), atColumn(j)));
    Clicking any button with any specific property:
    if("Button Caption Name".equals(link_Name().getProperty(".title")))
    {
    sleep(3);
    button_escalatesubmit_TL().click();
    System.out.println("Testing ");
    }
    else
    {
    button_escalatesubmit_TL().click(atPoint(918, 698));
    }
    http://rftsamplecode.blogspot.in/
    RFT Sample code

    Monday, January 31, 2011
    Code for clicking on a perticuler link on webpage
    public void Fn_ClickonLink(BrowserTestObject bwsobj, String ClsTag,String Propvalue,String ItemValue)
    {
    /*FunctionName:Fn_ClickonLink
    *Parameters:bwsobj(BrowserObject),ClsTag(Object Class property value),Propvalue(Name of the object),
    *ItemValue(The name of the link which we need to click)
    */
    String Selectalue;
    Selectalue="";
    TestObject [] childObj = bwsobj.find(atProperty(".class",ClsTag));

    for(int k=0;k<childObj.length;k++)
    {
    try
    {
    String str1=(String)((GuiTestObject) (childObj[k])).getProperty(".text");
    if(str1.equalsIgnoreCase(ItemValue))
    {
    ((GuiTestObject)(childObj[k])).click();
    logInfo("Link:"ItemValue"Found"+"Clicked on Link"+ItemValue);
    }
    else
    {
    logInfo("Link Not Found:");
    }
    }
    catch(Exception e)
    {
    System.out.println(e);
    }
    }
    }
    Posted by Varaprasad at 12:29 AM 0 comments
    Email ThisBlogThis!Share to TwitterShare to Facebook
    Wednesday, January 26, 2011
    Code for retrieving list of buttons from a web page and click on a button particular button

    public static void Fn_ClickOnButton(BrowserTestObject bwsobj, String ClsTag,String Propvalue,String IdValue)
    {
    String Selectalue;
    Selectalue=" ";

    TestObject [] childObj = find(atDescendant(".class",ClsTag,".value",Propvalue));
    System.out.println("Total no.of links on page:"+ childObj.length);

    GuiTestObject Button;
    if (childObj.length>1)
    {
    for(int k=0;k<childObj.length;k++)
    {

    try
    {
    String str1=(String)((GuiTestObject) (childObj[k])).getProperty(".value");
    String str2=(String)((GuiTestObject) (childObj[k])).getProperty(".id");

    String str3=(String)((GuiTestObject) (childObj[k])).getProperty(".type");

    if(str2.equalsIgnoreCase(IdValue))
    {
    ((GuiTestObject)(childObj[k])).hover();
    ((GuiTestObject)(childObj[k])).click();
    break;
    }
    }
    catch(Exception e)
    {
    System.out.println(e);
    }
    }
    }
    }

    Posted by Varaprasad at 10:18 PM 0 comments
    Email ThisBlogThis!Share to TwitterShare to Facebook
    Monday, January 24, 2011
    Code for closing all the opend browsers
    public void closeAllBrowser()
    {
    IWindow[] winsobj = getTopWindows();
    for (int idx = 0; idx < winsobj.length; ++idx)
    {
    if (winsidx.getWindowClassName().equals("IEFrame"))
    {
    winsidx.close();
    }
    }
    }
    Posted by Varaprasad at 9:40 PM 0 comments
    Email ThisBlogThis!Share to TwitterShare to Facebook
    Sunday, January 23, 2011
    To find a requested browser is opend or not
    public IWindow Return_FirefoxbrowserObject(String BrowserName)
    {
    int bol=1;
    IWindow[] wins = getTopWindows();
    IWindow winObj = null;
    for (int n = 0; n < wins.length; ++n)
    {

    if (wins[n].getWindowClassName().equals("MozillaUIWindowClass"))
    //IF you want to verify IE browser then keep IEFrame
    {
    if (wins[n].getText().substring(0,20).equals(BrowserName)) )
    {
    bol=0;
    winObj= wins[n];
    }
    else
    {
    wins[n].close();

    }
    }
    if(bol==0)
    {

    break;
    }
    }

    return winObj;
    }
    Posted by Varaprasad at 10:53 PM 1 comments
    Email ThisBlogThis!Share to TwitterShare to Facebook
    Sample code for capturing screenshot in RFT

    public void Fn_CaptureScreenShot(String Screenshotname)
    {
    Robot myRobot;
    try {
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    Dimension screenSize = toolkit.getScreenSize();
    Rectangle screenRect = new Rectangle(screenSize);
    Robot robot = new Robot();
    // Capture the screen shot of the area of the screen defined by the rectangle
    // BufferedImage bi=bc.getScreenSnapshot(new Rectangle(100,100));
    BufferedImage bi=robot.createScreenCapture(screenRect);
    ImageIO.write(bi, "jpg", new File("C:/SRM5510/"Screenshotname".jpg"));

    } catch (AWTException e) {
    e.printStackTrace();
    } catch (IOException e) {
    e.printStackTrace();
    }
    }
    Posted by Varaprasad at 10:46 PM 0 comments
    Email ThisBlogThis!Share to TwitterShare to Facebook
    Tuesday, January 18, 2011
    Script for Connecting to database and retrieving values from database in RFT
    public class database extends databaseHelper
    {
    /**
    • Script Name : database
    • Description : Functional Test Script
    */
    public void testMain(Object[] args)
    {
    Connection con; // The connection to the database.
    // The following code can throw errors, so they must be caught.
    try{
    // First, tell Java what driver to use and where to find it.
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    // Next, create a connection to your data source.
    // Specify that you are using the ODBC-JDBC Bridge.
    // And specify the data source from ODBC.
    con = DriverManager.getConnection("jdbc:odbc:QT_Flight32");
    // Create an SQL statement.
    Statement stmt = con.createStatement();
    // Execute some SQL to create a table in your database.
    // If the table already exists, an exception is thrown!
    //stmt.executeUpdate("CREATE TABLE COFFEES " +
    //"(COF_NAME VARCHAR(32), SUP_ID INTEGER, PRICE FLOAT, " +
    //"SALES INTEGER, TOTAL INTEGER)");

    ResultSet rs = stmt.executeQuery("select * from orders");
    while (rs.next())
    {
    String s = rs.getString("Customer_Name");
    int i = rs.getInt("Flight_Number");
    int o = rs.getInt("Order_Number");
    System.out.println(o + " : " + s + " : " + i);
    }
    con.close();
    }
    // Catch any exceptions that are thrown.
    catch(ClassNotFoundException e){
    System.out.println(e.toString());
    }
    catch(SQLException e){
    System.out.println(e.toString());
    }
    }
    }
    Posted by Varaprasad at 5:35 AM 0 comments
    Email ThisBlogThis!Share to TwitterShare to Facebook
    Monday, January 17, 2011
    code for finding list of listboxes in a webpage in RFT
    //TestObject [] childObj = find(atDescendant(".class",ClsTag,".id",Propvalue));
    SelectGuiSubitemTestObject listbox;
    ((SelectGuiSubitemTestObject)(childObj[0])).select(ItemValue);
    out.println("ItemValue"+ItemValue);
    Posted by Varaprasad at 10:30 PM 0 comments
    Email ThisBlogThis!Share to TwitterShare to Facebook
    Older Posts Home
    Subscribe to: Posts (Atom)
    Followers
    Blog Archive

    * ▼ 2011 (9)
    o ▼ January (9)
    + Code for clicking on a perticuler link on webpage
    + Code for retrieving list of buttons from a web pag...
    + Code for closing all the opend browsers
    + To find a requested browser is opend or not
    + Sample code for capturing screenshot in RFT
    + Script for Connecting to database and retrieving v...
    + code for finding list of listboxes in a webpage in...
    + Code for verifying expected message in RFT
    + Code for reading data from Datapool in RFT

    About Me

    Varaprasad

    View my complete profile

    Simple template. Powered by Blogger.
  • prashant_RPT
    prashant_RPT
    45 Posts

    Re: How to put verification point on column name

    ‏2012-06-09T11:32:50Z  
    http://rftsamplecode.blogspot.in/
    RFT Sample code

    Monday, January 31, 2011
    Code for clicking on a perticuler link on webpage
    public void Fn_ClickonLink(BrowserTestObject bwsobj, String ClsTag,String Propvalue,String ItemValue)
    {
    /*FunctionName:Fn_ClickonLink
    *Parameters:bwsobj(BrowserObject),ClsTag(Object Class property value),Propvalue(Name of the object),
    *ItemValue(The name of the link which we need to click)
    */
    String Selectalue;
    Selectalue="";
    TestObject [] childObj = bwsobj.find(atProperty(".class",ClsTag));

    for(int k=0;k<childObj.length;k++)
    {
    try
    {
    String str1=(String)((GuiTestObject) (childObj[k])).getProperty(".text");
    if(str1.equalsIgnoreCase(ItemValue))
    {
    ((GuiTestObject)(childObj[k])).click();
    logInfo("Link:"ItemValue"Found"+"Clicked on Link"+ItemValue);
    }
    else
    {
    logInfo("Link Not Found:");
    }
    }
    catch(Exception e)
    {
    System.out.println(e);
    }
    }
    }
    Posted by Varaprasad at 12:29 AM 0 comments
    Email ThisBlogThis!Share to TwitterShare to Facebook
    Wednesday, January 26, 2011
    Code for retrieving list of buttons from a web page and click on a button particular button

    public static void Fn_ClickOnButton(BrowserTestObject bwsobj, String ClsTag,String Propvalue,String IdValue)
    {
    String Selectalue;
    Selectalue=" ";

    TestObject [] childObj = find(atDescendant(".class",ClsTag,".value",Propvalue));
    System.out.println("Total no.of links on page:"+ childObj.length);

    GuiTestObject Button;
    if (childObj.length>1)
    {
    for(int k=0;k<childObj.length;k++)
    {

    try
    {
    String str1=(String)((GuiTestObject) (childObj[k])).getProperty(".value");
    String str2=(String)((GuiTestObject) (childObj[k])).getProperty(".id");

    String str3=(String)((GuiTestObject) (childObj[k])).getProperty(".type");

    if(str2.equalsIgnoreCase(IdValue))
    {
    ((GuiTestObject)(childObj[k])).hover();
    ((GuiTestObject)(childObj[k])).click();
    break;
    }
    }
    catch(Exception e)
    {
    System.out.println(e);
    }
    }
    }
    }

    Posted by Varaprasad at 10:18 PM 0 comments
    Email ThisBlogThis!Share to TwitterShare to Facebook
    Monday, January 24, 2011
    Code for closing all the opend browsers
    public void closeAllBrowser()
    {
    IWindow[] winsobj = getTopWindows();
    for (int idx = 0; idx < winsobj.length; ++idx)
    {
    if (winsidx.getWindowClassName().equals("IEFrame"))
    {
    winsidx.close();
    }
    }
    }
    Posted by Varaprasad at 9:40 PM 0 comments
    Email ThisBlogThis!Share to TwitterShare to Facebook
    Sunday, January 23, 2011
    To find a requested browser is opend or not
    public IWindow Return_FirefoxbrowserObject(String BrowserName)
    {
    int bol=1;
    IWindow[] wins = getTopWindows();
    IWindow winObj = null;
    for (int n = 0; n < wins.length; ++n)
    {

    if (wins[n].getWindowClassName().equals("MozillaUIWindowClass"))
    //IF you want to verify IE browser then keep IEFrame
    {
    if (wins[n].getText().substring(0,20).equals(BrowserName)) )
    {
    bol=0;
    winObj= wins[n];
    }
    else
    {
    wins[n].close();

    }
    }
    if(bol==0)
    {

    break;
    }
    }

    return winObj;
    }
    Posted by Varaprasad at 10:53 PM 1 comments
    Email ThisBlogThis!Share to TwitterShare to Facebook
    Sample code for capturing screenshot in RFT

    public void Fn_CaptureScreenShot(String Screenshotname)
    {
    Robot myRobot;
    try {
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    Dimension screenSize = toolkit.getScreenSize();
    Rectangle screenRect = new Rectangle(screenSize);
    Robot robot = new Robot();
    // Capture the screen shot of the area of the screen defined by the rectangle
    // BufferedImage bi=bc.getScreenSnapshot(new Rectangle(100,100));
    BufferedImage bi=robot.createScreenCapture(screenRect);
    ImageIO.write(bi, "jpg", new File("C:/SRM5510/"Screenshotname".jpg"));

    } catch (AWTException e) {
    e.printStackTrace();
    } catch (IOException e) {
    e.printStackTrace();
    }
    }
    Posted by Varaprasad at 10:46 PM 0 comments
    Email ThisBlogThis!Share to TwitterShare to Facebook
    Tuesday, January 18, 2011
    Script for Connecting to database and retrieving values from database in RFT
    public class database extends databaseHelper
    {
    /**
    • Script Name : database
    • Description : Functional Test Script
    */
    public void testMain(Object[] args)
    {
    Connection con; // The connection to the database.
    // The following code can throw errors, so they must be caught.
    try{
    // First, tell Java what driver to use and where to find it.
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    // Next, create a connection to your data source.
    // Specify that you are using the ODBC-JDBC Bridge.
    // And specify the data source from ODBC.
    con = DriverManager.getConnection("jdbc:odbc:QT_Flight32");
    // Create an SQL statement.
    Statement stmt = con.createStatement();
    // Execute some SQL to create a table in your database.
    // If the table already exists, an exception is thrown!
    //stmt.executeUpdate("CREATE TABLE COFFEES " +
    //"(COF_NAME VARCHAR(32), SUP_ID INTEGER, PRICE FLOAT, " +
    //"SALES INTEGER, TOTAL INTEGER)");

    ResultSet rs = stmt.executeQuery("select * from orders");
    while (rs.next())
    {
    String s = rs.getString("Customer_Name");
    int i = rs.getInt("Flight_Number");
    int o = rs.getInt("Order_Number");
    System.out.println(o + " : " + s + " : " + i);
    }
    con.close();
    }
    // Catch any exceptions that are thrown.
    catch(ClassNotFoundException e){
    System.out.println(e.toString());
    }
    catch(SQLException e){
    System.out.println(e.toString());
    }
    }
    }
    Posted by Varaprasad at 5:35 AM 0 comments
    Email ThisBlogThis!Share to TwitterShare to Facebook
    Monday, January 17, 2011
    code for finding list of listboxes in a webpage in RFT
    //TestObject [] childObj = find(atDescendant(".class",ClsTag,".id",Propvalue));
    SelectGuiSubitemTestObject listbox;
    ((SelectGuiSubitemTestObject)(childObj[0])).select(ItemValue);
    out.println("ItemValue"+ItemValue);
    Posted by Varaprasad at 10:30 PM 0 comments
    Email ThisBlogThis!Share to TwitterShare to Facebook
    Older Posts Home
    Subscribe to: Posts (Atom)
    Followers
    Blog Archive

    * ▼ 2011 (9)
    o ▼ January (9)
    + Code for clicking on a perticuler link on webpage
    + Code for retrieving list of buttons from a web pag...
    + Code for closing all the opend browsers
    + To find a requested browser is opend or not
    + Sample code for capturing screenshot in RFT
    + Script for Connecting to database and retrieving v...
    + code for finding list of listboxes in a webpage in...
    + Code for verifying expected message in RFT
    + Code for reading data from Datapool in RFT

    About Me

    Varaprasad

    View my complete profile

    Simple template. Powered by Blogger.
    Sorry posted wrong data
  • prashant_RPT
    prashant_RPT
    45 Posts

    Re: How to put verification point on column name

    ‏2012-06-21T01:01:03Z  
    Sorry posted wrong data
    ITestDataList iList = (ITestDataList)
    testObject.getTestData("list");
    int count = iList.getElementCount();
    ITestDataElementList iElementList = iList.getElements();
    for (int i = 0; i < count; i++) {
    ITestDataElement iElement = iElementList.getElement(i);
    String value = iElement.getElement().toString();

    }