We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d08a0c1 commit ae9a5bfCopy full SHA for ae9a5bf
lib/WebDriverTargetLocator.php
@@ -41,10 +41,18 @@ public function defaultContent() {
41
/**
42
* Switch to the iframe by its id or name.
43
*
44
+ * @param WebDriverElement|string $frame The WebDriverElement,
45
+ the id or the name of the frame.
46
* @return WebDriver The driver focused on the given frame.
47
*/
- public function frame($id_or_name) {
- $params = array('id' => (string)$id_or_name);
48
+ public function frame($frame) {
49
+ if ($frame instanceof WebDriverElement) {
50
+ $id = array('ELEMENT' => $frame->getID());
51
+ } else {
52
+ $id = (string)$frame;
53
+ }
54
+
55
+ $params = array('id' => $id);
56
$this->executor->execute('focusFrame', $params);
57
58
return $this->driver;
0 commit comments