pop up window how to ignore
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
pop up window how to ignore
Hi,
I am having an issue and asking for help 😞
I have keyword testcases running on a particular website with no problem.
However business implemented redcently a pop up that randomly shows up on a home page which blocks the page and brakes the test cases.
The only way to get rid of that is by clicking "no thanks" on a pop up.
Is there a way i can record a keyword test case that lets says "if" the pop up present- hit "no thank you "else"- ignore.
Thanks
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You definitely can do this by checking the existance of the object.
Basically it would come down to
if (Object.Exists) { Object.Button.Click() } else { Log.Message("Popup Does Not Exist.") }
Check here for how to accomplish this with a keyword test.
https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/checking-existence.html
Thanks,
Carson
Click the Accept as Solution button if my answer has helped
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If you know when this pop-up can be displayed, than Carson's suggestion is the way to go.
If the pop-up can be displayed unpredictably (e.g. by timer, some randomizer, etc.) then you may consider one of the OnXXX events of TestComplete (e.g. OnUnexpectedWindow, OnOverlappedWindow, etc., the exact event to use depends on the design and behaviour of the tested web page.) and implement the similar code that will check if pop-up is displayed and close it.
/Alex [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
Thank you!
So here is what I did.
I recorded the test and clicked on the "no thank you button" to get the object name.
then I created a script and added it to the keyword test right before the moment when the pop up sometimes pop ups.
here is the script:
function Test()
{
if (Object.Exists) {
Object.Button.Click(Aliases.browser.pageStagingConsolidatedcreditKin.panelBxCampaign.panel.panel.panelBxCreative.panel.panelBxStep1.formBxFormStep1.buttonNoThanksIMJustLookingForNo)
}
else {
Log.Message("Popup Does Not Exist.")
} }
What could be wrong?
it runs fine when the pop up is not there and the report gives me a message that pop up does not exist, but the times when it does pops up TC does not click on no thank you button.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Take your recorded test and use the Convert To Script function to double check the syntax where you clicked on the button.
https://support.smartbear.com/testcomplete/docs/keyword-testing/converting-script.html
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
What I provided was pseudo code not exactly what you should be using.
You need to check if YOUR object exists, not just Object. Think about it this way, in your provided code what is Object? It's not defined to be anything, so there would never be an Exists == true in it.
Then you need to call the click method on your button, not Object.Click(<yourButton>). Click is a method provided by Test Complete for all on screen objects.
I also have a feeling you might end up with problems with that record and play back because your using the automatic name mapping with a lot of objects that you don't actually interact with in your Aliases.
Definitely reccomend reading through all of the documentation about name mapping here: https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/inde...
Relying just on the auto generated object mapping is setting yourself up for some major headaches in the future.
Thanks,
Carson
Click the Accept as Solution button if my answer has helped
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see what you mean, Im not really good with scripting, but understand your logic.
I think I figured how to do the "click object",
but how do I define the object?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You don't have to do it via scripting if you're not comfortable with it.
https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/checking-existence.html
That provides step by step instructions on how to accomplish the same thing in a keyword test.
Thanks,
Carson
Click the Accept as Solution button if my answer has helped
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, I was able to figure this out with keyword test
