/** * Implementation of setUpBeforeClass() method in the object context, called as setUpBeforeTests()<br> * Used ONLY one time before execution of each class (tests in test class) * @throws Exception */ private function setUpBeforeTestClass() { $currentTestClass = get_class($this); static $setUpBeforeTestsError = null; if (self::$_testClass != $currentTestClass) { self::$_testClass = $currentTestClass; //work with xpath for IE $browser = $this->drivers[0]->getBrowserSettings(); if (strstr($browser['browser'], '*ie') !== false) { $this->useXpathLibrary('javascript-xpath'); $this->allowNativeXpath(true); } $this->setLastTestNameInClass(); try { $setUpBeforeTestsError = null; $this->setUpBeforeTests(); } catch (Exception $e) { $setUpBeforeTestsError = "\nError in setUpBeforeTests method for '" . $currentTestClass . "' class:\n" . $e->getMessage(); } if (isset($e)) { throw $e; } } if ($setUpBeforeTestsError !== null) { $this->markTestSkipped($setUpBeforeTestsError); } }