Download presentation
Presentation is loading. Please wait.
Published byMiranda Griffith Modified over 8 years ago
1
ScriptOnce™ & Best Practices
2
Agenda 2 Automation that works ScriptOnce –Minimal maintenance –Easy to add devices Robustness –Reliable Scripts - Minimize False Alerts
3
ScriptOnce
4
Before Starting Scripting 4 Let’s Investigate before we start Don’t write on one device
5
Objects vs Visual 5 Object commands are better for ScriptOnce and should form the majority of the interactions –Analyzing text on screen (Edit Get) should be done with objects as the text received will be 100% correct and not reliant on OCR Visual should be used for validation and not operations –Text is preferred to image, it will be identical across devices and can be data-driven and support multiple languages When using offsets, always use percentage and not pixels. –Images are trickier, screen sizes & platforms may break the script so it is less advisable to use Remember to always use bounded image!
6
Avoid “Device Specific” Commands 6 A device specific command is dependent on a particular screen size and works by coordinates and not object/visual recognition –Touch –Drag –Swipe –Gesture Why do the commands exist? –Backward compatibility for old scripts –VERY rare cases they are useful Use Set commands to insert text instead of type –Type is fragile, does not know where to type
7
Robust Scripting
8
Working with Applications 8 Applications are updated daily –It is easy to work on the wrong version How to avoid? –Install & Launch application at beginning of script –Install from repository or upload via API –Close & Uninstall at end of script so device is clean
9
Working with Website 9 It is best to work with a “Clean Browser” –Browser clean (currently Android only) should be used at beginning of script (see go to website sample user function) Work with OS browsers (Web Inspector iOS only) –Safari for iOS –Chrome for Android –Avoid PM browser (legacy) Use PM Browser commands
10
Object Click, Visual Sync, Object Click 10 Clicking on the device triggers an event –New page –Popup –Field entered After the click, we want to validate that we are where we should be – the sync –Sync is a text checkpoint with default timeout of 60 The click should be done via an object as it is more robust and ScriptOnce The sync should be done with visual –The true way to check as it tests the UX –Careful not to sync an element that existed on the previous page
11
Devices Need to Breathe 11 Different devices have different CPUs Some actions take back end processing time To cover it we need to: –Use the Timeout parameter When a page is loading When a backend transaction is occurring (e.g. purchase, finding a flight etc.) –Use the wait command After Edit Set When the device needs 2-3 seconds to “calm down”
12
Structuring Scripts 12 Create “Main” Script –Run each module separately –The main script is one for all devices –The modules can use user functions or execute script Create Maintenance script –Deal with known issues that may occur in App Location popups Upgrade popups –Power Cycle & Device Recover –Upon error run the script
13
So, I Think It Works?! 13 Let’s do some basic sanity Orientation –Use same script –Switch device orientation EARLY in flow to see all ok Loop 10 times on the most popular devices to see all is well
14
Next Steps.....Get Certified! 14 Become a Perfecto Mobile Specialist in Automation! HOW? Log in to www.perfectomobileacademy.com and register.www.perfectomobileacademy.com Click on Self-Paced eLearning and select the Selenium WebDriver course. Take the Final Exam for Specialist Certification (SA) Good Luck!
15
Thank You
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.