Ask a Question

Desktop Application Lag and BDD

SOLVED
DanielM75
Occasional Contributor

Desktop Application Lag and BDD

Hello Everyone, two questions for you.

 

1. We are executing some testing in Australia connecting to a PC in the US.  Running a desktop app remotely.

The scripts are unreliable - sometimes they work, and then sometimes they can't find an object.

So it seems to be due to lag and slowness of the PC.

 

I saw in another solution that you can wait for each object to become available, would that be the best suggestion here?

i.e.

def wait_for_something_exists(something, timeout):
  counter = 0
  while not something.Exists and c < timeout:
    aqUtils.Delay(1000) # or time.sleep(1)
    counter += 1

 

2.  I am very new to BDD.  I have some code written and it works, but the goes through my entire code twice.  I only want it to iterate for each example certain parts of the code.

i.e. my code is this:

 

Feature: Generate Check

 @StartApp
 @EndAp

Scenario Outline: Generate checks
When I load the Checks forms
When I load the <Customer>
Then I generate check(s) for <Customer>

Examples:
|Customer|
|1000000025 |
|1000000025 |

I am using hooks to start and end the application.

 

What I want it to do is only execute these lines for each example:

When I load the <Customer>
Then I generate check(s) for <Customer>

 

But it executes everything, including the hooks.

4 REPLIES 4
tristaanogre
Esteemed Contributor

I'm not very good at BDD either... but the wait code.... it's alot simpler than that.

 

So, let's say you have an object... Aliases.MyApp.MyForm.MyButton... and you want to wait for the button.  Do this.

 

(code is pseudo JavaScript)

 

if (Aliases.MyApp.MyForm.WaitAliasChild('MyButton', 20000).Exists) {
    Log.Message('The object existss')
    Aliases.MyApp.MyForm.MyButton.Click()
}
else Log.Message('The object does not exist')

There are a variety of "wait" functions and methods built in to TestComplete which will wait for an object to exist.  If it does exist, the function actually returns the object itself.  If it does not exist, the function will return a "stub" object with one property (Exists) set to False.


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
DanielM75
Occasional Contributor

Great thanks I will check this out

sonya_m
SmartBear Alumni (Retired)

Thank you tristaanogre!

 

@DanielM75 did you give this a try? Please share your results.


Sonya Mihaljova
Community and Education Specialist

DanielM75
Occasional Contributor

Yes I did and it definately helped thank you

cancel
Showing results for 
Search instead for 
Did you mean: