+91 (172) 5048500

Frequently asked questions on the Selenium Hybrid Framework

Q. Why have we created XSLT reports instead of using TestNG reports alone?

  1. TestNG reports are not easy to understand and are technical in nature. XSLT reports are more user friendly and interactive if these reports are to be shared with the clients or managers.

Q. How is TestNG different from Junit?

  1. In Junit, test reports can only be generated by using it with Ant however in TestNG, reports can be generated without using Ant.

Q. How to run all the Test scripts in a suite and access TestNG reports?

  1. Test scripts can be run in a suite by following these steps:
  • Go to ‘testing.xml’ file and right click on it.
  • Select the option as ‘Run As TestNG Suite’.
  • TestNG reports can be accessed by going into test-output folder and opening theindex.html file in the browser by giving its path.
  • Q. Can we run the script without using eclipse or ant?

    1. Yes, we can run the script without using eclipse or ant by creating a bat file by following these steps:
    • Open a notepad file.
    • Mention the path of the project stored on your hard drive.
    • Write the commands as “ant clean compile run makexsltreports”.
    • Refer to the following example:
    • cd D:\marketo_auto_lat\Grazitti_Hybrid_Framework_Version4
    • ant clean compile run makexsltreports
    • Save it in double quotes as "TEST_SUITE.bat"
    • Once it gets saved, we can run the script by double clicking on this bat file.

    Q. How to generate XSLT reports?

    1. Follow these steps to generate XSLT reports
    • Import two jar files assaxon.jar&saxliason.jar.
    • Open the command line interface.
    • Mention the path of the project.
    • Write ant commands for compiling the code, executing the test scripts and generating xslt reports. Refer the following commands to be written inside command line interface:
    • cd D:\marketo_auto_lat\Grazitti_Hybrid_Framework_Version4
    • ant
    • ant compile
    • ant run
    • antmakexsltreports
    • Refresh your project.
    • Two new folders will be created as‘XSLT_Reports’ and ‘build’.
    • Openindex.html file in a browser by going into XSLT_Reports folder, you’ll see the XSLT reports.

    Q. What type of keywords we can use in this framework?

    1. There are two kinds of keywords we can use:
    • Generic keywords: These keywords can be applied to any application like clicking on an element, entering text in a text box, selecting a drop down list etc.
    • Application specific keywords: These keywords are specific to an application under test like verifying a login process, extracting the text of specific elements in a webtable etc.

    Q. How can we mouse hover on an element?

    1. We can mouse hover on an element by using the following piece of code:
    • Actions act = new Actions(driver);
    • WebElement hover = driver.findElement(By.xpath(OR.getProperty(object)));
    • act.moveToElement(hover).build().perform();

    Q. How can I change the browser to be used for running the test scripts?

    1. Go to file under the package ‘com.hybrid.config’.
    2. Mention the browser name in the ‘bType’ key value pair.

    Q. Are we storing screenshots in case ofTest script failure?

    1. Yes, in case any of the Keywords fail written in the script, a screenshot corresponding to that gets stored in the screenshots folder.

    Q. How to use TestNG in eclipse?

    1. TestNG can be installed by following the steps as:
    • In Eclipse, go to Help tab and select ‘Install New Software’ option.
    • Once you'll get TestNG option, select it and click finish.
    • To verify whether it has been successfully installed, check TestNG option by selecting the Show view option under Window tab.

    Get In Touch