Download presentation
Presentation is loading. Please wait.
1
Selenium HP Web Test Tool Training
Portnov Computer School Selenium HP Web Test Tool Training Test Automation For Web-Based Applications Presenter: Ellie Skobel
2
Day 4 Using JavaScript in Selenium IDE Scripts
3
Selenium Accessors. Some of the key accessors are: storeValue
storeEval You can store any value into a variable using accessors. Variable substitution provides a simple way to include a previously stored variable in a command parameter If you give the variable name: var_name Using the variable like: ${var_name} will substitute the actual value in the place of the variable. Use echo ${var_name} to display the values in the Log.
4
MAP Maps provide a more general way of storing elements.
Allows to store pairs of elements, termed "keys" and "values", where each key maps to one value. Cannot contain duplicate keys (duplicate variable names Here Keys refers Selenium variable Names and values refers to their values.
5
storedVars All the variables are stored in a map named storedVars
storedVars allows you to access the ${var_name} using the “varName” key within the map. Using storedVars you can reference the values within Javascript Evaluation code
6
JavaScript Evaluation
JavaScript snippet can be given using the following syntax. Javascript { <code snippet goes here> } The code given is treated as a JavaScript code and executed. storedVars Map can be used to access the previously stored variables Variable substitution should be handled carefully within the JavaScript code.
7
storedVars Evaluation Example
javascript { storedVars['num1'] + storedVars['num2'] }
8
Eval commands Can be used to process the JavaScript code without using javascript{…} sintax assertEval assertNotEval verifyEval verifyNotEval waitForEval waitForNotEval storeEval
9
Expression commands assertExpression assertNotExpression
Are used to compare two values or variables assertExpression assertNotExpression verifyExpression verifyNotExpression waitForExpression waitForNotExpression storeExpression store waitForCondition
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.