cancel
Showing results for 
Search instead for 
Did you mean: 

How do i run the same Keyword Test on a different urls?

SOLVED
Highlighted
Occasional Contributor

How do i run the same Keyword Test on a different urls?

How do i run the same Keyword Test on a different urls?

 

For example:
I want to go to https://eoffice.epartconnection.com and fill in the login info and click submit.

Then, I want to go to https://eoffice.staging.epartconnection.com and preform the same test.

 

When I try this now it give me this error:

The test object was not found when executing the Click command:
Aliases.browser.pageEofficeEpartconnectionCom.formForm1.textboxStoreidtextbox

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: How do i run the same Keyword Test on a different urls?

If you want to go in and change the value manually every time, use the project variable directions from your original thread:

https://community.smartbear.com/t5/TestComplete-Functional-Web/Is-it-possible-to-run-a-data-loop-wit...

 

Then in your test, you will build the object name 

"Aliases.browser." + myvariablename + ".formForm1.passwordboxPasswordtextbox" 

 

and use eval to make it an actual object that you can enter text into or click or whatever.

 

------

 

If you want to enter the value automatically and have the test run in a loop, you can put the URL values in a spreadsheet and at the top of the loop, read the URL into the project variable and the rest will be the same as above.

 

 

View solution in original post

4 REPLIES 4
Highlighted
Community Hero

Re: How do i run the same Keyword Test on a different urls?

We answered your "different URLs" question in this thread and you accepted the solution:

https://community.smartbear.com/t5/TestComplete-Functional-Web/Is-it-possible-to-run-a-data-loop-wit...

 

The error you are asking about now is something different.  

 

"The test object was not found when executing the Click command" is telling you that TestComplete is trying to click something and it can't see it on the current page.

 

Is Aliases.browser.pageEofficeEpartconnectionCom.formForm1.textboxStoreidtextbox the correct object to be clicking at this point in the test?

Highlighted
Community Hero

Re: How do i run the same Keyword Test on a different urls?

My guess is that in your NameMapping for your pageEofficeEpartconnectionCom, you have the URL hard coded to one or the other of the URL's you're using for testing.  You need to adjust this mapping.  Your best bet, given your URL's, is to use conditional mapping where you can indicate that the URL property value for the page can be one value OR another value.  Please see https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/mana...


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Occasional Contributor

Re: How do i run the same Keyword Test on a different urls?

I did as told and went into the name mapping to add an or statement in which it takes in either URLs. 

However, I was more looking for a solution that would swap out the domain for another one.

for example:


The object name for the password text box for the password input on the first website is 

Aliases.browser.pageEofficeEpartconnectionCom.formForm1.passwordboxPasswordtextbox

 

The object name for the other website is

Aliases.browser.pageLocalhost65214.formForm1.passwordboxPasswordtextbox

 

I would like to be able to freely swap out the underlined portions freely so that when I run the tests, the program can detect the objects properly.

Highlighted
Community Hero

Re: How do i run the same Keyword Test on a different urls?

If you want to go in and change the value manually every time, use the project variable directions from your original thread:

https://community.smartbear.com/t5/TestComplete-Functional-Web/Is-it-possible-to-run-a-data-loop-wit...

 

Then in your test, you will build the object name 

"Aliases.browser." + myvariablename + ".formForm1.passwordboxPasswordtextbox" 

 

and use eval to make it an actual object that you can enter text into or click or whatever.

 

------

 

If you want to enter the value automatically and have the test run in a loop, you can put the URL values in a spreadsheet and at the top of the loop, read the URL into the project variable and the rest will be the same as above.

 

 

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
Let's start July with new challenges!

Create a script to pass custom command-line arguments as a test parameter for the TechCorner tag!

Will you dare to take the challenge?


Top Kudoed Authors