|
var more = more || initalizeMore();
is a common practice in javascript.
|
|
|
|
|
Now, I'm not going to look at the other answers before I post so I don't know if others have got it right, or if there are additional nuggets of information. If ProcessFlyouts returns true then the second test isn't carried out - it's a conditional OR statement. So, if you want ProcessCarrierAnimations to be evaluated, convert it to
more = more | ProcessCarrierAnimations();
|
|
|
|
|
How about:
more &= ProcessCarrierAnimations();
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Is it just me that would have done it as a oneliner?
|
|
|
|
|
That could make setting a breakpoint on the second call difficult. :shrug:
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
No big deal to change if necessary. :shrug:
But I actually find it easier to read on one line.
|
|
|
|
|
|
There's a risk that ProcessCarrierAnimations() may never be invoked, so the right thing (IMHO) would be to do something like this:
bool processFlyouts = ProcessFlyouts();
bool processCarrierAnimations = ProcessCarrierAnimations();
bool more = processFlyouts || processCarrierAnimations;
/ravi
|
|
|
|
|
No it did not do anything unexpected. || operator uses short-circuit evaluation. I would assume the intent was to call ProcessCarrierAnimations only if more was false.
|
|
|
|
|
It compiled?
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
This is JavaScript style, the developer meant, if "more" is "undefined" then try the other option ProcessCarrierAnimations(). But obviously, this doesn't work in C#.
Make it simple, as simple as possible, but not simpler.
|
|
|
|
|
Just to be contrary:
bool more = false;
if (ProcessFlyouts()) more = true;
if (ProcessCarrierAnimations()) more = true;
Software Zen: delete this;
|
|
|
|
|
The "early out" semantics of the logical operators (|| and &&) are the same for C#, C++, Java, and C, and have been well-specified since the First Edition of K&R C. How could the result possibly be unexpected?
Truth,
James
|
|
|
|
|
My bet is that ProcessCarrierAnimations isn't executed if ProcessFlyouts returns true.
If ProcessCarrierAnimations should still be called, you could remove one of the "vertical bars", changing the "short-circuit" OR into a regular logical-OR.
Richard
|
|
|
|
|
hhhmmm...I never thought of bitwise operators as being the 'regular' ones; quite the contrary, actually.
|
|
|
|
|
It failed to run ProcessCarrierAnimations because more was already true, and thus the evaluator short-circuited. You want something like this:
bool more=ProcessFlyouts();
bool more2=ProcessCarrierAnimations();
more = more || more2;
|
|
|
|
|
if(!ProcessFlyouts())
{
ProcessCarrierAnimations()
}
|
|
|
|
|
We have a third party web app that the business uses, and we support. We have many hooks into, and a lot of web services built around it to get data in and out.
The hardest thing we have is regression testing the third party app. Does anyone know of any good tools to automate the UI testing of this application? We have tried Selenium WebDriver, but due to the way the application is built, it doesn't work. It has a lot of javascript injection of items into its pages.
Thanks!
|
|
|
|
|
Not tried using it yet, but we've started using a framework called Coypu. There a few frameworks out there: Selenium, WatiN, couldn't tell you the merits of them.
|
|
|
|
|
AutoHotKey[^] - anything that lets you write macros.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
It is possible to use Selenium on pages that do dynamic content loading. It requires a lot of waiting for elements with known IDs or consistent XPaths to be present before proceeding to the next step. At my company we've developed a wrapper toolkit around Selenium (it can use other drivers, too, but I've only experience with the Selenium part) which allows us to write automated tests against that type of site more easily. Unfortunately I can't give you it but I recommend you do something similar, I don't think there are any automated web testing kits that make it straightforward.
Testing this kind of site will always be slow and unreliable, as with any UI testing and particularly network-dependent testing. But it can be automated with Selenium.
|
|
|
|
|
That's what I was trying (I believe). I had it load the login page, and was able to get it to fill out the user id/password, and submit.
I then used the F12 tool in Internet Explorer to find the ids of objects that would load after login, and I put in a wait for those, but it always fails. Maybe I'm not waiting long enough like you said. I'll increase the timeout and see what happens.
|
|
|
|
|
In some cases, I've had to skip the built in wait and use the execute javascript on the page in a loop in order to find elements and execute handlers that weren't triggered on a selenium click for some reason.
Also, I've found a series of short waits in a loop to be more reliable than one longer wait.
|
|
|
|
|
Take a look at http://www.sikuli.org/[^]. It may help you automate things better if selenium is not an option.
--
"My software never has bugs. It just develops random features."
|
|
|
|
|
A Halo for NGC 6164 [^]
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
Those who seek perfection will only find imperfection
nils illegitimus carborundum
me, me, me
me, in pictures
|
|
|
|