I'm trying to automate the application using Selenium WebDriver. My application sends sms with confirmation code which is used in turn to confirm the changes on web-page. Could you advise please how can I automate this functionality? Where can I extract the confirmation code sent by sms? Thank you!
Automation the testing of application sending sms
4.9k Views Asked by Luanya At
2
There are 2 best solutions below
0

If you use testRigor system it has built-in way to test SMS and your code would look like this:
click "Sign in"
enter "user" into "Username"
enter "password123" into "Password"
click "Verify me"
check that sms to "+12345678902" is delivered and matches regex "Code\:\d\d\d\d" and save it as "sms"
extract value by regex "(?<=Code\:)[0-9]{4}" from "sms" and save it as "confirmationCode"
enter saved value "confirmationCode" into "code"
click "Continue to Login"
check that page contains text "Welcome, Peter!"
Related Questions in JAVA
- Optimum directory structure for large number of files to display on a page
- install a R package from directory
- Are stringified MongoDB ObjectID's safe as folder names?
- Generate TCPDF output to a shared drive folder
- Get number of files in various subdirectories relative to the current page - ColdFusion
- Ruby on Windows XP: How to change directory of SSL certificates
- Google Drive API VB.NET Parent Folder of a Folder
- Count files in a directory while excluding others by directory and subdirectories using PHP
- Media files end up in in a pycharm subdirectory when uploading
- Remove part of filename of files that are in different folders
Related Questions in TESTING
- Optimum directory structure for large number of files to display on a page
- install a R package from directory
- Are stringified MongoDB ObjectID's safe as folder names?
- Generate TCPDF output to a shared drive folder
- Get number of files in various subdirectories relative to the current page - ColdFusion
- Ruby on Windows XP: How to change directory of SSL certificates
- Google Drive API VB.NET Parent Folder of a Folder
- Count files in a directory while excluding others by directory and subdirectories using PHP
- Media files end up in in a pycharm subdirectory when uploading
- Remove part of filename of files that are in different folders
Related Questions in SELENIUM-WEBDRIVER
- Optimum directory structure for large number of files to display on a page
- install a R package from directory
- Are stringified MongoDB ObjectID's safe as folder names?
- Generate TCPDF output to a shared drive folder
- Get number of files in various subdirectories relative to the current page - ColdFusion
- Ruby on Windows XP: How to change directory of SSL certificates
- Google Drive API VB.NET Parent Folder of a Folder
- Count files in a directory while excluding others by directory and subdirectories using PHP
- Media files end up in in a pycharm subdirectory when uploading
- Remove part of filename of files that are in different folders
Related Questions in AUTOMATION
- Optimum directory structure for large number of files to display on a page
- install a R package from directory
- Are stringified MongoDB ObjectID's safe as folder names?
- Generate TCPDF output to a shared drive folder
- Get number of files in various subdirectories relative to the current page - ColdFusion
- Ruby on Windows XP: How to change directory of SSL certificates
- Google Drive API VB.NET Parent Folder of a Folder
- Count files in a directory while excluding others by directory and subdirectories using PHP
- Media files end up in in a pycharm subdirectory when uploading
- Remove part of filename of files that are in different folders
Related Questions in SMS
- Optimum directory structure for large number of files to display on a page
- install a R package from directory
- Are stringified MongoDB ObjectID's safe as folder names?
- Generate TCPDF output to a shared drive folder
- Get number of files in various subdirectories relative to the current page - ColdFusion
- Ruby on Windows XP: How to change directory of SSL certificates
- Google Drive API VB.NET Parent Folder of a Folder
- Count files in a directory while excluding others by directory and subdirectories using PHP
- Media files end up in in a pycharm subdirectory when uploading
- Remove part of filename of files that are in different folders
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I suppose you have to test the following scenario:
I suppose that your intention to test just the site behaviour but not functionality of sending and receiving SMS. I also suppose that the confirmation code is not expired.
In order to test just this functionality I suggest to use the predefined scenario. You will take the confirmation code that you have from the manual test and use it in your web site selenium automation. This is good enough to verify described functionality.
In case if the confirmation code has the expiration period I suggest to use the code that developers use in order to build this confirmation code in your method.
The last option (if you don't have access to the development code) - using the mobile automation (like appium) with the mobile simulator in order to receive the confirmation code. In this case the site will send the sms to the mobile simulator (please see this question how to simulate the mobile device number) and your appium code will take it and save in the local file. Then the selenium code will use it. This approach much more complicated but will cover end to end scenario.