Nexial Automation

Test Automation Platform for everyone!

X

Setting Up Your First Project

Creating Your First Project

Creating Project Structure

  1. Open the command prompt and change the current directory to the "bin" directory under the Nexial installation directory. To do this,
    1. type c: and ENTER
    2. type cd C:\projects\nexial-core\bin and then ENTER
  2. From here, let's create a new Nexial project via the nexial-project utility.
    At the command prompt, enter nexial-project.cmd MyFirstProject
  3. If everything works, then you should see the message creating project home at ... and DONE
  4. You should see the following directory created, along with various files in it:

Do not close the command prompt as you will need this later.


Additional References

  1. To gain better understanding of the project structure, check out  Understanding Nexial project structure
  2. To gain better understanding of the Nexial automation script format and usage, check out  Understanding Nexial Test Artifact

Now it’s time to run some automation!

Running your first test automation

The “Hello World” of Nexial automation

  1. Open C:\projects\MyFirstProject\artifact\script\MyFirstProject.xlsx (Windows) or $HOME/MyFirstProject/artifact/script/MyFirstProject.xlsx (Mac) created in the previous process - we refer to this Excel file as the test script or the automation script. By convention all Excel files under the artifact/script directory are considered as automation scripts.

  2. Start the first test case by doing the following:
    1. Enter “Greetings” under the activity column. This column’s purpose is to group a series of actions with a meaningful name.
      activity
    2. Under the description column, enter “say hello”. This column is used to contain the description of what the corresponding action should do.
      description
    3. In the cmd type column, there should be a drop down menu. From this menu, select “base”. This column organizes and specifies various types of Nexial commands.
      cmd type
    4. In the command column, you can now select a new command from the drop down menu. The commands you can select from in this column come from a Nexial list of commands labeled as “base” commands due to the type of command we selected in the cmd type column from the previous step.
      For our first script, we will select, verbose(text).
      command
    5. In the param 1 column, type in Hello World. This column as well as the other param # columns are parameters that you fill in based on the command column’s required parameter. In our example, the “verbose(text)” command requires text as a parameter.
      param1

    Your project should now look something like this:
    finishedresult

  3. Save/close this automation script.

  4. Return back to the command prompt and type: nexial.cmd -script (leaving a space before and after -script). Either,
    1. Manually type the location of MyFirstProject.xlsx file that we were working on -
      (Windows) C:\projects\MyFirstProject\artifact\script\MyFirstProject.xlsx or
      (MacOS) ~/MyFirstProject/artifact/script/MyFirstProject.xlsx
    2. Drag and drop the xlsx file into the command prompt. After doing either step 1 or 2, press Enter and wait a little bit.
  5. If all’s well, you should see something like the following on your console:
    nexial_output 

    For now, don’t worry too much about these logs. The most critical portion is near the end where Nexial reports a summary of the test. The above screenshot showed that 1 iteration ran, with 1 step completed within 842ms.

  6. After the above finishes processing and if your “artifact/data/MyFirstProject.data.xlsx” file (Excel file located in the “artifact/data” folder) has nexial.openResult set as true, two things should open up:
    1. An Excel should open a new spreadsheet displaying the output of the test you just ran.
    2. Your main browser should open up a web page with the execution summary of the test we just ran.

    The new Excel file should look something like this:
    Excel_output
    Meanwhile, your browser should display something like this:
    browser_output

Congratulations! You have just successfully run your first automation script via Nexial. Let’s dig deeper…

a little bit more…

  1. let’s create a few more lines for this test case: MORE TO COME…

Diving Deeper

  1. install .NET Framework 4.6.2 for desktop automation