EPF_Command_Guide V1.3

AutonomIQ Inc May 2, 2019

Commands & Instructions

Open/Window

1. Open/Launch/Go to/navigate website [url]

"open website https://www.google.com"

"go to website https://www.google.com"

2. Switch to first/second/1/1st/2/2nd/3/3rd/original/new tab/window

"switch to new tab"

this will move focus on other pop-up windows If new window comes-up

"switch to original window"

this will get the focus back to the original window if a new window comes down

"switch to 3rd tab"

this will move focus to another pop-up window If multiple window comes-up

3. Switch to alert/prompt/confirm and click on ok/accept/leave/cancel/stay

"switch to alert and click on ok"

4. Set screen/window size - [width * height]

"set screen size - 500 * 500"

"set screen size 500*500"

"set window size - 500 * 500"

"set window size 500 * 500"

Click - Select - Choose

Click/Press on/at [element text]

"click on user name" | "click at user name"

"press on password" | "press at password"

Click/Press on/at [radio/checkbox] next to [element text]

"click on the radio next to username"

"press at the radio next to password"

Select/choose [element text]

"select username" / "choose password" + data tab should deliver the data which should be selected

"select Passed in Status"

Passed is the value in the dropdown with Status as the title of the dropdown

Enter

1. Enter/Type in/fill in/set text in [field]

"enter hanSong in username"

"type in hanSong in username"

"fill in hanSong in username"

Hover

Hover over/on [field]

"hover over username" / "hover on username"

Validations

Using Assert will ensure that the testcase fails and halts at the failed step

Using Verify will ensure that the testcase fails but the execution will not halt. It will proceed to the next step.

1. Verify {xpath: "xpath"} is [xpath]

"verify {xpath: "//img[@class='gb_Wa']"} is {xpath: "//img[@class='gb_Wa']"}"

2. Verify {xpath: "xpath"} [contains/begins with/ends with] [text]

"verify {xpath: "//img[@class='gb_Wa']"} begins with google"

3. Verify {xpath: "xpath"} [contains/begins with/ends with] [text] [or] [contains/begins with/ends with]

"verify {xpath: "//img[@class='gb_Wa']"} begins with goo or ends with gle"

4. Verify {xpath: "xpath"} is [disabled/enabled/visible/not visible]

"verify {xpath: "//img[@class='gb_Wa']"} is disabled"

5. Verify {xpath: "xpath"} width/height/font-family/text-align/font-size/display/color/background-color is "some value"

"verify {xpath: : "//img[@class='gb_Wa']"} color is #e01719

6. Verify the current URL is [url]

"verify the current URL is https://www.test.com/"

7. Verify new window/tab/alert/pop up/pop-up exists

"verify new window exists" / "verify new alert exists"

8. Verify new window/tab/alert/pop up/pop-up exists

"verify new window exists" / "verify new alert exists"

9. Verify variable ${variable_name} is "some_text"

"verify variable ${var_1} is "test"

10. Verify image of "something" is on the page.

"verify image of 'person', 'man' is on the page"

11. Verify "some text" is on the screen.

"verify 'login' is on the screen"

12. Verify name/placeholder/data-toggle/value/class/type/any-attr of {xpath: "xpath"} is "some value"

"verify name of {xpath: "//img[@class='gb_Wa']"} is test"

Conditional Instructions

Instructions are executed if a specific condition is true

"if {condition}, {some instruction to execute if condition is true}"

eg. if current url is "https://...", enter userrname.

Condition is similar to as 'verify'. Use if instead of verify if other instrucitons are to be performed after it

if current url is "some_url",

if {xpath:'xpath_'} is visible, Click on Submit

Looping Statements

Defining a Block

"begin block {instruction1}{instruction2}....end block"

eg:
begin block sample_block open website
enter username
enter password
click on login
end block

Loops (Running block)

"run ${block_name} for (number) times"

eg. run ${sample_block} for 2 times

"run ${block_name} for (number/all) rows"

eg. run ${sample_block} for all rows

eg. User name password user1 pass1 user2 pass2

Waits

Wait for {number} seconds/secs

"wait for 3 seconds"

"wait for 5 secs"

Wait until element is visible/exists

"wait until username is visible"

"wait until username is exists"

Other Misc

Use custom code from

"use custom code from" + data tab should contain the name of the file!!

Upload file to [field]

" upload file to 'select xls,xlsx or csv file' "

"Create random variable " for a random alphanumeric string

"Create random variable my_project_name"

and save it as

"Enter username and save it as my_name"

${variable_name} to reference a previously saved variable

"Enter ${my_name}"

{today, } to get today's date in the specified format

"Enter Date" + data tab could have {today, dd/mm/yy} "Enter Date" + data tab could have {today, mm/dd/yy} "Enter Date" + data tab could have {today, yy/mm/dd}

Relative Date support in Data Sources/Files

used format is not case-sensitive

For running a job which should use today's date: {Today, MM/dd/yyyy}

2 days ago from now: {Today - 2{dd}, MM/dd/yyyy}

2 days later from now: {Today + 2{dd}, MM/dd/yyyy}

1 month ago from now: {Today - 1{mm}, MM/dd/yyyy}

1 month later from now: {Today + 1{mm}, MM/dd/yyyy}

1 year ago from now: {Today - 1{yy}, MM/dd/yyyy}

1 year later from now: {Today + 1{yy}, MM/dd/yyyy}

Random number support

In the data tab, "#{AnomTest\d\d\d\d\d\d\d}" is transformed into below AnomTest1657483

(not precisely correct, 'cause It's randomly generated every time)

Saving a variable from label on page or xpath

"save {xpath:"xpath_value"} as " "save [element text] as "

Next to/before/after

"click on edit next (to) Donald" "click on radio before " "enter user name after "

Script Execution

Exec _js/py/sh/java{} with ${input_variable_names} returning ${output_variable_name}

"exec _py{print('printing variable: ' +aiq_1)} with ${var_1} returning ${var_2}"

"exec _js{return 'printing variable: ' + aiq_1} with ${var_1} returning ${var_2}"

"exec _sh(echo 'printing variable: ' + aiq_1) with ${var_1} returning ${var_2}"

( if var = "testing", var_2 = "printing variable: testing" )

Using Excel Formula

_(xl|var){"excel formula"} as

same format with excel formula

eg. _xl{TEXT(TODAY(), "mm-dd-yy")} as date ( date: 02-13-2019 )

eg. _xl{SUM("$15", "$16")} as sum ( sum : 31 )

Table Instructions

This will work for HTML tables with table-tr-td tags. This command identifies the cell below First Column for which Second Columns value matches.

Click on "FirstColumnName" Where SecondColumnName [operator] SecondColumnValue

Examples with different operators given below

"Click on "Move" Where Winning % is 55.71"

"Click on "Black" Where Black Elo is not undefined"

"Click on "White" Where White Elo greater than 2700"

"Click on "Move" Where Winning % lesser than 55"

"Click on "White" Where White Elo begins with I"

"Click on "Wins" Where Move starts with g"

"Click on "Black" Where Date ends with ?"

"Click on "White" Where Date contains 1994"

"Click on "White" Where White Elo != undefined"

"Click on "Move" where Winning % > 55"

"Click on "Move" Where Winning % < 55"

"Click on "Move" Where Winning % <= 55"

"Click on "Move" Where Wins >= 70060"

"Click on "Move" Where Wins = 70060"

Enter text

"Enter text in "Review" Where Location is Mysore"

Radio Button Selection

"Click on radio in "No" Where Location is Mysore"

Checkbox Selection

"Click on checkbox in "Choose" Where Name is Anki"

DropDown Selection

"Choose "Books" Where Name is SKM"

"Choose "The Shinning" Where Name is Anki"

Click/ Enter text based on row number

Other similar commands are listed below

"Click on "Move" Where row is 3"

"Click on "Move" Where row is last"

Get the table row count returned to test step as a variable

"Get table row count as variable_Name"