Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Clarification regarding Thread.sleep usage #23

Open
swathikvsr opened this issue Apr 6, 2016 · 1 comment
Open

Clarification regarding Thread.sleep usage #23

swathikvsr opened this issue Apr 6, 2016 · 1 comment

Comments

@swathikvsr
Copy link

I found after googling about time delays that we should be using Thread.sleep in the worst case but I found that https://github.com/ProtoTest/ProtoTest.Golem/blob/master/ProtoTest.Golem/Core/Common.cs#L185

is using the Thread.sleep() for all kinds of delay. Doesn't this affect the performance? What's the idea behind the Thread.sleep() usage here ? Please correct me as I am new to the selenium stuff...

@bkitchener1
Copy link
Member

You don't want to use static sleep commands in your tests, you should
always try to use wait conditions instead. These are dynamic, and will
only wait until the criteria has passed before continuing. But inside the
framework, sleep commands have to be used as its the only real way to make
a thread wait. If you look inside the selenium-webdriver code you will see
sleep commands there as well. But like all rules, there's always
exceptions There are instances where a static sleep can be useful.
However typically you want to wait for some condition instead ofusing a
sleep whenever possible.

On Tue, Apr 5, 2016 at 5:42 PM, swathikvsr notifications@github.com wrote:

I found after googling about time delays that we should be using
Thread.sleep in the worst case but I found that
https://github.com/ProtoTest/ProtoTest.Golem/blob/master/ProtoTest.Golem/Core/Common.cs#L185

is using the Thread.sleep() for all kinds of delay. Doesn't this affect
the performance? Please correct me as I am new to the selenium stuff...


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#23

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants