Login

Login
  • Register
  • VectorDesign blog

    Testing Automation and general Tech Geek stuff

    Java Doc tags

    Tag Description Syntax @author Adds the author of a class. @author name-text {@code} Displays text in code font without interpreting the text as HTML markup or nested javadoc tags. {@code text} {@docRoot} Represents the relative path to the generated document’s root directory from any generated page. {@docRoot} @deprecated Adds a comment indicating that this API […]

    Monday, July 1st, 2019

    Read XLS using Java and Apache POI

    public static final String SAMPLE_XLSX_FILE_PATH = “./testData.xls”; Workbook workbook = WorkbookFactory.create(new File(SAMPLE_XLSX_FILE_PATH)); workbook.getSheetAt(0).getRow(0).getCell(1)

    Wednesday, June 6th, 2018

    Assersion vs IF ElSE Statement

    The main thing you should keep in mind is that the if-else statement should be used for program flow control and the assert keyword should only be used for testing purposes. You should never use asserts to actually perform any operation required for your application to work properly. According to Sun’s official Java documentation: “Each […]

    Thursday, August 31st, 2017

    Java Naming Conventions

    Identifier Type Rules for Naming Examples Packages The prefix of a unique package name is always written in all-lowercase ASCII letters and should be one of the top-level domain names, currently com, edu, gov, mil, net, org, or one of the English two-letter codes identifying countries as specified in ISO Standard 3166, 1981.Subsequent components of […]

    Wednesday, July 29th, 2015

    Starting Selenium hub and nodes

    starting hub java -jar selenium-server-standalone-2.44.0.jar -role hub Starting node java -jar selenium-server-standalone-2.44.0.jar -role node -hub http://localhost:4444/grid/register If you want to set a specific port java -jar selenium-server-standalone-2.44.0.jar -role hub -port 4441

    Wednesday, July 22nd, 2015

    handle browser user authentication pop up

    One of the usual problems in testing is getting access to the test environment. Usually a test server is setup where a users authentication is required in order to access the application under test. In most  browsers (firefox,chrome, safari ect) this can be easily achieved by parsing the credentials in the url like so http://USERNAME:PASSWORD@www.testdomain.com […]

    Tuesday, July 21st, 2015

    JAVA ROBOTS

    This class is used to generate native system input events for the purposes of test automation, self-running demos, and other applications where control of the mouse and keyboard is needed. The primary purpose of Robot is to facilitate automated testing of Java platform implementations.   http://docs.oracle.com/javase/7/docs/api/java/awt/Robot.html

    Tuesday, July 21st, 2015

    Get Driver Information

    Capabilities caps = ((RemoteWebDriver) driver).getCapabilities(); String browserName = caps.getBrowserName(); String browserVersion = caps.getVersion();

    Friday, June 26th, 2015

    Java Robots and Selenium

    Still if you want to move the mouse pointer physically, you need to take different approach using Robot class Point coordinates = driver.findElement(By.id(“ctl00_portalmaster_txtUserName”)).getLocation(); Robot robot = new Robot(); robot.mouseMove(coordinates.getX(),coordinates.getY()+120); Webdriver provide document coordinates, where as Robot class is based on Screen coordinates, so I have added +120 to compensate the browser header. Screen Coordinates: These […]

    Thursday, March 19th, 2015