Man of Honour
Morning!
So this should be easy, but for some reason my brain isn't functioning at the moment
The problem I'm having is, say the top one returns false, but the other two return true, the false value will be lost and the function that uses this return value will see it as true, when really it should be a failure. Sometimes there could be up to 12 of these calls, so don't really want 12 seperate bool variables, so is there a way of doing this using the same variable, but will drop out the function if one returns true, failing that, will run through the entire function but return false if any of the statements at any point returned false?
Thanks guys, apologies if I explained that badly, like I said, just one of those days that my brain isn't firing!![Big Grin :D :D](/styles/default/xenforo/vbSmilies/Normal/biggrin.gif)
So this should be easy, but for some reason my brain isn't functioning at the moment
Code:
public static bool CheckOCRLanguagePageLoadCorrectly(IWebDriver driver)
{
Selenium.ClickLinkByText(driver, "OCR Language");
bool success = PageObjects.CheckOldPageActiomBarLoadsCorrectly(driver);
success = PageObjects.CheckSearchOptionsLoadsCorrectly(driver);
success = PageObjects.CheckDataGridLoadsCorrectly(driver);
return success;
}
The problem I'm having is, say the top one returns false, but the other two return true, the false value will be lost and the function that uses this return value will see it as true, when really it should be a failure. Sometimes there could be up to 12 of these calls, so don't really want 12 seperate bool variables, so is there a way of doing this using the same variable, but will drop out the function if one returns true, failing that, will run through the entire function but return false if any of the statements at any point returned false?
Thanks guys, apologies if I explained that badly, like I said, just one of those days that my brain isn't firing!
![Big Grin :D :D](/styles/default/xenforo/vbSmilies/Normal/biggrin.gif)
Last edited: