Conditions | 5 |
Paths | 12 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
21 | public function switchToIFrame($iFrameElement) |
||
22 | { |
||
23 | $iFrame = null; |
||
24 | |||
25 | if (is_string($iFrameElement)) { |
||
26 | $iFrame = $this->getElementObject($iFrameElement); |
||
27 | } |
||
28 | |||
29 | if (is_object($iFrameElement)) { |
||
30 | $iFrame = $iFrameElement; |
||
31 | } |
||
32 | |||
33 | if ($iFrame instanceof Element) { |
||
34 | $reflectedElement = new \ReflectionClass($iFrame); |
||
35 | if ($reflectedElement->hasMethod('getCssId') === false) { |
||
36 | throw new \ReflectionException("getCssId method not in Element " . get_class($iFrame)); |
||
37 | } |
||
38 | $iFrameId = $iFrame->getCssId(); |
||
39 | $this->getDriver()->switchToIFrame($iFrameId); |
||
40 | } |
||
41 | } |
||
42 | |||
51 |