Copy tests if they are similar
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Copy tests if they are similar
Can I copy one test to another if theyare similar and manually make few changes?
eg. In login test, I may have valid login/pwd as one test
In another, it may just be valid login and invalid password.
Instead of recording a whole new test, can I copy the first test and just make changes?
Partha Mandayam
Software Consultant
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would prefer creating a common function for login and call them in individual test.
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You didn't understand
There are two tests, one is a successful login and another is unsuccessful.
Since the only difference is the password, I want to copy the first and create the second test.
Is there a way to do that?
@shankar_r wrote:
I would prefer creating a common function for login and call them in individual test.
Partha Mandayam
Software Consultant
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@shankar_r is right. You could have a common login function and then call it once with successful data and once with unsuccessful data.
But can you copy one test to another? Sure. Select all the code in the one you have and copy it. Add a new blank test and paste. Done.
You can also make a copy of the test file in the TC directory with a new name, then in the Project you can use the Add Existing feature to add that renamed test into the list.
Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How would I create a commonlogin function and call it from multiple tests?
@Marsha_R wrote:
@shankar_r is right. You could have a common login function and then call it once with successful data and once with unsuccessful data.
But can you copy one test to another? Sure. Select all the code in the one you have and copy it. Add a new blank test and paste. Done.
You can also make a copy of the test file in the TC directory with a new name, then in the Project you can use the Add Existing feature to add that renamed test into the list.
Partha Mandayam
Software Consultant
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A simple function will look like below,
function loginMyPage(strUserName,strPassword){ var loginWindow = Aliases.App.LoginWindow; loginWindow.txtUserName.Keys(strUserName); loginWindow.txtPassword.Keys(strPassword); loginWindow.btnSubmit.Click(); }
Using this option you can call this function in Tests.
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks
What is
Aliases.App.LoginWindow
@shankar_r wrote:
A simple function will look like below,
function loginMyPage(strUserName,strPassword){ var loginWindow = Aliases.App.LoginWindow; loginWindow.txtUserName.Keys(strUserName); loginWindow.txtPassword.Keys(strPassword); loginWindow.btnSubmit.Click(); }Using this option you can call this function in Tests.
Partha Mandayam
Software Consultant
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@mcp111 wrote:
Thanks
What is
Aliases.App.LoginWindow
This is the NameMapping of my login window.
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks.
So how do I find name mapping of my login window?
@shankar_r wrote:
@mcp111 wrote:
Thanks
What is
Aliases.App.LoginWindow
This is the NameMapping of my login window.
Partha Mandayam
Software Consultant
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
These are all basic items of TestComplete, I suggest you attend or watch the TestComplete 101 training.
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”