PageRenderTime 58ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/new/seleniumrc/selenium-remote-control-1.0-beta-2/selenium-php-client-driver-1.0-beta-2/PEAR/Testing/Selenium.php

https://bitbucket.org/rgbkrk/python-scraping-code-samples
PHP | 2706 lines | 664 code | 301 blank | 1741 comment | 5 complexity | 7f2469e6f7ae39d1fdf287dc10d7b280 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /** Copyright 2006 ThoughtWorks, Inc
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. * -----------------
  17. * This file has been automatically generated via XSL
  18. * -----------------
  19. *
  20. *
  21. *
  22. * @category Testing
  23. * @package Selenium
  24. * @author Shin Ohno <ganchiku at gmail dot com>
  25. * @author Bjoern Schotte <schotte at mayflower dot de>
  26. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  27. * @version @package_version@
  28. * @see http://www.openqa.org/selenium-rc/
  29. * @since 0.1
  30. */
  31. /**
  32. * Selenium exception class
  33. */
  34. require_once 'Testing/Selenium/Exception.php';
  35. /**
  36. * Defines an object that runs Selenium commands.
  37. *
  38. *
  39. * <p>
  40. * <b>Element Locators</b>
  41. * </p><p>
  42. *
  43. * Element Locators tell Selenium which HTML element a command refers to.
  44. * The format of a locator is:
  45. * </p><p>
  46. *
  47. * <i>locatorType</i><b>=</b><i>argument</i>
  48. * </p>
  49. * <p>
  50. *
  51. * We support the following strategies for locating elements:
  52. *
  53. * </p>
  54. * <ul>
  55. *
  56. * <li>
  57. * <b>identifier</b>=<i>id</i>:
  58. * Select the element with the specified @id attribute. If no match is
  59. * found, select the first element whose @name attribute is <i>id</i>.
  60. * (This is normally the default; see below.)
  61. * </li>
  62. * <li>
  63. * <b>id</b>=<i>id</i>:
  64. * Select the element with the specified @id attribute.
  65. * </li>
  66. * <li>
  67. * <b>name</b>=<i>name</i>:
  68. * Select the first element with the specified @name attribute.
  69. *
  70. * <ul>
  71. *
  72. * <li>
  73. * username
  74. * </li>
  75. * <li>
  76. * name=username
  77. * </li>
  78. * </ul>
  79. <p>
  80. * The name may optionally be followed by one or more <i>element-filters</i>, separated from the name by whitespace. If the <i>filterType</i> is not specified, <b>value</b> is assumed.
  81. * </p>
  82. * <ul>
  83. *
  84. * <li>
  85. * name=flavour value=chocolate
  86. * </li>
  87. * </ul>
  88. * </li>
  89. * <li>
  90. * <b>dom</b>=<i>javascriptExpression</i>:
  91. *
  92. * Find an element by evaluating the specified string. This allows you to traverse the HTML Document Object
  93. * Model using JavaScript. Note that you must not return a value in this string; simply make it the last expression in the block.
  94. *
  95. * <ul>
  96. *
  97. * <li>
  98. * dom=document.forms['myForm'].myDropdown
  99. * </li>
  100. * <li>
  101. * dom=document.images[56]
  102. * </li>
  103. * <li>
  104. * dom=function foo() { return document.links[1]; }; foo();
  105. * </li>
  106. * </ul>
  107. * </li>
  108. * <li>
  109. * <b>xpath</b>=<i>xpathExpression</i>:
  110. * Locate an element using an XPath expression.
  111. *
  112. * <ul>
  113. *
  114. * <li>
  115. * xpath=//img[@alt='The image alt text']
  116. * </li>
  117. * <li>
  118. * xpath=//table[@id='table1']//tr[4]/td[2]
  119. * </li>
  120. * <li>
  121. * xpath=//a[contains(@href,'#id1')]
  122. * </li>
  123. * <li>
  124. * xpath=//a[contains(@href,'#id1')]/@class
  125. * </li>
  126. * <li>
  127. * xpath=(//table[@class='stylee'])//th[text()='theHeaderText']/../td
  128. * </li>
  129. * <li>
  130. * xpath=//input[@name='name2' and @value='yes']
  131. * </li>
  132. * <li>
  133. * xpath=//*[text()="right"]
  134. * </li>
  135. * </ul>
  136. * </li>
  137. * <li>
  138. * <b>link</b>=<i>textPattern</i>:
  139. * Select the link (anchor) element which contains text matching the
  140. * specified <i>pattern</i>.
  141. *
  142. * <ul>
  143. *
  144. * <li>
  145. * link=The link text
  146. * </li>
  147. * </ul>
  148. * </li>
  149. * <li>
  150. * <b>css</b>=<i>cssSelectorSyntax</i>:
  151. * Select the element using css selectors. Please refer to CSS2 selectors, CSS3 selectors for more information. You can also check the TestCssLocators test in the selenium test suite for an example of usage, which is included in the downloaded selenium core package.
  152. *
  153. * <ul>
  154. *
  155. * <li>
  156. * css=a[href="#id3"]
  157. * </li>
  158. * <li>
  159. * css=span#firstChild + span
  160. * </li>
  161. * </ul>
  162. <p>
  163. * Currently the css selector locator supports all css1, css2 and css3 selectors except namespace in css3, some pseudo classes(:nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type, :visited, :hover, :active, :focus, :indeterminate) and pseudo elements(::first-line, ::first-letter, ::selection, ::before, ::after).
  164. * </p>
  165. * </li>
  166. * <li>
  167. * <b>ui</b>=<i>uiSpecifierString</i>:
  168. * Locate an element by resolving the UI specifier string to another locator, and evaluating it. See the Selenium UI-Element Reference for more details.
  169. *
  170. * <ul>
  171. *
  172. * <li>
  173. * ui=loginPages::loginButton()
  174. * </li>
  175. * <li>
  176. * ui=settingsPages::toggle(label=Hide Email)
  177. * </li>
  178. * <li>
  179. * ui=forumPages::postBody(index=2)//a[2]
  180. * </li>
  181. * </ul>
  182. * </li>
  183. * </ul><p>
  184. *
  185. * Without an explicit locator prefix, Selenium uses the following default
  186. * strategies:
  187. *
  188. * </p>
  189. * <ul>
  190. *
  191. * <li>
  192. * <b>dom</b>, for locators starting with "document."
  193. * </li>
  194. * <li>
  195. * <b>xpath</b>, for locators starting with "//"
  196. * </li>
  197. * <li>
  198. * <b>identifier</b>, otherwise
  199. * </li>
  200. * </ul>
  201. * <p>
  202. * <b>Element Filters</b>
  203. * </p><p>
  204. *
  205. * <p>
  206. * Element filters can be used with a locator to refine a list of candidate elements. They are currently used only in the 'name' element-locator.
  207. * </p>
  208. <p>
  209. * Filters look much like locators, ie.
  210. * </p>
  211. <p>
  212. *
  213. * <i>filterType</i><b>=</b><i>argument</i>
  214. * </p>
  215. * <p>
  216. * Supported element-filters are:
  217. * </p>
  218. <p>
  219. * <b>value=</b><i>valuePattern</i>
  220. * </p>
  221. <p>
  222. *
  223. *
  224. * Matches elements based on their values. This is particularly useful for refining a list of similarly-named toggle-buttons.
  225. * </p>
  226. * <p>
  227. * <b>index=</b><i>index</i>
  228. * </p>
  229. <p>
  230. *
  231. *
  232. * Selects a single element based on its position in the list (offset from zero).
  233. * </p>
  234. *
  235. * </p>
  236. *
  237. * <p>
  238. * <b>String-match Patterns</b>
  239. * </p><p>
  240. *
  241. * Various Pattern syntaxes are available for matching string values:
  242. *
  243. * </p>
  244. * <ul>
  245. *
  246. * <li>
  247. * <b>glob:</b><i>pattern</i>:
  248. * Match a string against a "glob" (aka "wildmat") pattern. "Glob" is a
  249. * kind of limited regular-expression syntax typically used in command-line
  250. * shells. In a glob pattern, "*" represents any sequence of characters, and "?"
  251. * represents any single character. Glob patterns match against the entire
  252. * string.
  253. * </li>
  254. * <li>
  255. * <b>regexp:</b><i>regexp</i>:
  256. * Match a string using a regular-expression. The full power of JavaScript
  257. * regular-expressions is available.
  258. * </li>
  259. * <li>
  260. * <b>regexpi:</b><i>regexpi</i>:
  261. * Match a string using a case-insensitive regular-expression.
  262. * </li>
  263. * <li>
  264. * <b>exact:</b><i>string</i>:
  265. *
  266. * Match a string exactly, verbatim, without any of that fancy wildcard
  267. * stuff.
  268. * </li>
  269. * </ul><p>
  270. *
  271. * If no pattern prefix is specified, Selenium assumes that it's a "glob"
  272. * pattern.
  273. *
  274. * </p><p>
  275. *
  276. * For commands that return multiple values (such as verifySelectOptions),
  277. * the string being matched is a comma-separated list of the return values,
  278. * where both commas and backslashes in the values are backslash-escaped.
  279. * When providing a pattern, the optional matching syntax (i.e. glob,
  280. * regexp, etc.) is specified once, as usual, at the beginning of the
  281. * pattern.
  282. *
  283. * </p>
  284. *
  285. * @package Selenium
  286. * @author Shin Ohno <ganchiku at gmail dot com>
  287. * @author Bjoern Schotte <schotte at mayflower dot de>
  288. */
  289. class Testing_Selenium
  290. {
  291. /**
  292. * @var string
  293. * @access private
  294. */
  295. private $browser;
  296. /**
  297. * @var string
  298. * @access private
  299. */
  300. private $browserUrl;
  301. /**
  302. * @var string
  303. * @access private
  304. */
  305. private $host;
  306. /**
  307. * @var int
  308. * @access private
  309. */
  310. private $port;
  311. /**
  312. * @var string
  313. * @access private
  314. */
  315. private $sessionId;
  316. /**
  317. * @var string
  318. * @access private
  319. */
  320. private $timeout;
  321. /**
  322. * Constructor
  323. *
  324. * @param string $browser
  325. * @param string $browserUrl
  326. * @param string $host
  327. * @param int $port
  328. * @param int $timeout
  329. * @access public
  330. * @throws Testing_Selenium_Exception
  331. */
  332. public function __construct($browser, $browserUrl, $host = 'localhost', $port = 4444, $timeout = 30000)
  333. {
  334. $this->browser = $browser;
  335. $this->browserUrl = $browserUrl;
  336. $this->host = $host;
  337. $this->port = $port;
  338. $this->timeout = $timeout;
  339. }
  340. /**
  341. * Run the browser and set session id.
  342. *
  343. * @access public
  344. * @return void
  345. */
  346. public function start()
  347. {
  348. $this->sessionId = $this->getString("getNewBrowserSession", array($this->browser, $this->browserUrl));
  349. return $this->sessionId;
  350. }
  351. /**
  352. * Close the browser and set session id null
  353. *
  354. * @access public
  355. * @return void
  356. */
  357. public function stop()
  358. {
  359. $this->doCommand("testComplete");
  360. $this->sessionId = null;
  361. }
  362. /**
  363. * Clicks on a link, button, checkbox or radio button. If the click action
  364. * causes a new page to load (like a link usually does), call
  365. * waitForPageToLoad.
  366. *
  367. * @access public
  368. * @param string $locator an element locator
  369. */
  370. public function click($locator)
  371. {
  372. $this->doCommand("click", array($locator));
  373. }
  374. /**
  375. * Double clicks on a link, button, checkbox or radio button. If the double click action
  376. * causes a new page to load (like a link usually does), call
  377. * waitForPageToLoad.
  378. *
  379. * @access public
  380. * @param string $locator an element locator
  381. */
  382. public function doubleClick($locator)
  383. {
  384. $this->doCommand("doubleClick", array($locator));
  385. }
  386. /**
  387. * Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element).
  388. *
  389. * @access public
  390. * @param string $locator an element locator
  391. */
  392. public function contextMenu($locator)
  393. {
  394. $this->doCommand("contextMenu", array($locator));
  395. }
  396. /**
  397. * Clicks on a link, button, checkbox or radio button. If the click action
  398. * causes a new page to load (like a link usually does), call
  399. * waitForPageToLoad.
  400. *
  401. * @access public
  402. * @param string $locator an element locator
  403. * @param string $coordString specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.
  404. */
  405. public function clickAt($locator, $coordString)
  406. {
  407. $this->doCommand("clickAt", array($locator, $coordString));
  408. }
  409. /**
  410. * Doubleclicks on a link, button, checkbox or radio button. If the action
  411. * causes a new page to load (like a link usually does), call
  412. * waitForPageToLoad.
  413. *
  414. * @access public
  415. * @param string $locator an element locator
  416. * @param string $coordString specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.
  417. */
  418. public function doubleClickAt($locator, $coordString)
  419. {
  420. $this->doCommand("doubleClickAt", array($locator, $coordString));
  421. }
  422. /**
  423. * Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element).
  424. *
  425. * @access public
  426. * @param string $locator an element locator
  427. * @param string $coordString specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.
  428. */
  429. public function contextMenuAt($locator, $coordString)
  430. {
  431. $this->doCommand("contextMenuAt", array($locator, $coordString));
  432. }
  433. /**
  434. * Explicitly simulate an event, to trigger the corresponding "on<i>event</i>"
  435. * handler.
  436. *
  437. * @access public
  438. * @param string $locator an element locator
  439. * @param string $eventName the event name, e.g. "focus" or "blur"
  440. */
  441. public function fireEvent($locator, $eventName)
  442. {
  443. $this->doCommand("fireEvent", array($locator, $eventName));
  444. }
  445. /**
  446. * Move the focus to the specified element; for example, if the element is an input field, move the cursor to that field.
  447. *
  448. * @access public
  449. * @param string $locator an element locator
  450. */
  451. public function focus($locator)
  452. {
  453. $this->doCommand("focus", array($locator));
  454. }
  455. /**
  456. * Simulates a user pressing and releasing a key.
  457. *
  458. * @access public
  459. * @param string $locator an element locator
  460. * @param string $keySequence Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119".
  461. */
  462. public function keyPress($locator, $keySequence)
  463. {
  464. $this->doCommand("keyPress", array($locator, $keySequence));
  465. }
  466. /**
  467. * Press the shift key and hold it down until doShiftUp() is called or a new page is loaded.
  468. *
  469. * @access public
  470. */
  471. public function shiftKeyDown()
  472. {
  473. $this->doCommand("shiftKeyDown", array());
  474. }
  475. /**
  476. * Release the shift key.
  477. *
  478. * @access public
  479. */
  480. public function shiftKeyUp()
  481. {
  482. $this->doCommand("shiftKeyUp", array());
  483. }
  484. /**
  485. * Press the meta key and hold it down until doMetaUp() is called or a new page is loaded.
  486. *
  487. * @access public
  488. */
  489. public function metaKeyDown()
  490. {
  491. $this->doCommand("metaKeyDown", array());
  492. }
  493. /**
  494. * Release the meta key.
  495. *
  496. * @access public
  497. */
  498. public function metaKeyUp()
  499. {
  500. $this->doCommand("metaKeyUp", array());
  501. }
  502. /**
  503. * Press the alt key and hold it down until doAltUp() is called or a new page is loaded.
  504. *
  505. * @access public
  506. */
  507. public function altKeyDown()
  508. {
  509. $this->doCommand("altKeyDown", array());
  510. }
  511. /**
  512. * Release the alt key.
  513. *
  514. * @access public
  515. */
  516. public function altKeyUp()
  517. {
  518. $this->doCommand("altKeyUp", array());
  519. }
  520. /**
  521. * Press the control key and hold it down until doControlUp() is called or a new page is loaded.
  522. *
  523. * @access public
  524. */
  525. public function controlKeyDown()
  526. {
  527. $this->doCommand("controlKeyDown", array());
  528. }
  529. /**
  530. * Release the control key.
  531. *
  532. * @access public
  533. */
  534. public function controlKeyUp()
  535. {
  536. $this->doCommand("controlKeyUp", array());
  537. }
  538. /**
  539. * Simulates a user pressing a key (without releasing it yet).
  540. *
  541. * @access public
  542. * @param string $locator an element locator
  543. * @param string $keySequence Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119".
  544. */
  545. public function keyDown($locator, $keySequence)
  546. {
  547. $this->doCommand("keyDown", array($locator, $keySequence));
  548. }
  549. /**
  550. * Simulates a user releasing a key.
  551. *
  552. * @access public
  553. * @param string $locator an element locator
  554. * @param string $keySequence Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119".
  555. */
  556. public function keyUp($locator, $keySequence)
  557. {
  558. $this->doCommand("keyUp", array($locator, $keySequence));
  559. }
  560. /**
  561. * Simulates a user hovering a mouse over the specified element.
  562. *
  563. * @access public
  564. * @param string $locator an element locator
  565. */
  566. public function mouseOver($locator)
  567. {
  568. $this->doCommand("mouseOver", array($locator));
  569. }
  570. /**
  571. * Simulates a user moving the mouse pointer away from the specified element.
  572. *
  573. * @access public
  574. * @param string $locator an element locator
  575. */
  576. public function mouseOut($locator)
  577. {
  578. $this->doCommand("mouseOut", array($locator));
  579. }
  580. /**
  581. * Simulates a user pressing the left mouse button (without releasing it yet) on
  582. * the specified element.
  583. *
  584. * @access public
  585. * @param string $locator an element locator
  586. */
  587. public function mouseDown($locator)
  588. {
  589. $this->doCommand("mouseDown", array($locator));
  590. }
  591. /**
  592. * Simulates a user pressing the right mouse button (without releasing it yet) on
  593. * the specified element.
  594. *
  595. * @access public
  596. * @param string $locator an element locator
  597. */
  598. public function mouseDownRight($locator)
  599. {
  600. $this->doCommand("mouseDownRight", array($locator));
  601. }
  602. /**
  603. * Simulates a user pressing the left mouse button (without releasing it yet) at
  604. * the specified location.
  605. *
  606. * @access public
  607. * @param string $locator an element locator
  608. * @param string $coordString specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.
  609. */
  610. public function mouseDownAt($locator, $coordString)
  611. {
  612. $this->doCommand("mouseDownAt", array($locator, $coordString));
  613. }
  614. /**
  615. * Simulates a user pressing the right mouse button (without releasing it yet) at
  616. * the specified location.
  617. *
  618. * @access public
  619. * @param string $locator an element locator
  620. * @param string $coordString specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.
  621. */
  622. public function mouseDownRightAt($locator, $coordString)
  623. {
  624. $this->doCommand("mouseDownRightAt", array($locator, $coordString));
  625. }
  626. /**
  627. * Simulates the event that occurs when the user releases the mouse button (i.e., stops
  628. * holding the button down) on the specified element.
  629. *
  630. * @access public
  631. * @param string $locator an element locator
  632. */
  633. public function mouseUp($locator)
  634. {
  635. $this->doCommand("mouseUp", array($locator));
  636. }
  637. /**
  638. * Simulates the event that occurs when the user releases the right mouse button (i.e., stops
  639. * holding the button down) on the specified element.
  640. *
  641. * @access public
  642. * @param string $locator an element locator
  643. */
  644. public function mouseUpRight($locator)
  645. {
  646. $this->doCommand("mouseUpRight", array($locator));
  647. }
  648. /**
  649. * Simulates the event that occurs when the user releases the mouse button (i.e., stops
  650. * holding the button down) at the specified location.
  651. *
  652. * @access public
  653. * @param string $locator an element locator
  654. * @param string $coordString specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.
  655. */
  656. public function mouseUpAt($locator, $coordString)
  657. {
  658. $this->doCommand("mouseUpAt", array($locator, $coordString));
  659. }
  660. /**
  661. * Simulates the event that occurs when the user releases the right mouse button (i.e., stops
  662. * holding the button down) at the specified location.
  663. *
  664. * @access public
  665. * @param string $locator an element locator
  666. * @param string $coordString specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.
  667. */
  668. public function mouseUpRightAt($locator, $coordString)
  669. {
  670. $this->doCommand("mouseUpRightAt", array($locator, $coordString));
  671. }
  672. /**
  673. * Simulates a user pressing the mouse button (without releasing it yet) on
  674. * the specified element.
  675. *
  676. * @access public
  677. * @param string $locator an element locator
  678. */
  679. public function mouseMove($locator)
  680. {
  681. $this->doCommand("mouseMove", array($locator));
  682. }
  683. /**
  684. * Simulates a user pressing the mouse button (without releasing it yet) on
  685. * the specified element.
  686. *
  687. * @access public
  688. * @param string $locator an element locator
  689. * @param string $coordString specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.
  690. */
  691. public function mouseMoveAt($locator, $coordString)
  692. {
  693. $this->doCommand("mouseMoveAt", array($locator, $coordString));
  694. }
  695. /**
  696. * Sets the value of an input field, as though you typed it in.
  697. *
  698. * <p>
  699. * Can also be used to set the value of combo boxes, check boxes, etc. In these cases,
  700. * value should be the value of the option selected, not the visible text.
  701. * </p>
  702. *
  703. * @access public
  704. * @param string $locator an element locator
  705. * @param string $value the value to type
  706. */
  707. public function type($locator, $value)
  708. {
  709. $this->doCommand("type", array($locator, $value));
  710. }
  711. /**
  712. * Simulates keystroke events on the specified element, as though you typed the value key-by-key.
  713. *
  714. * <p>
  715. * This is a convenience method for calling keyDown, keyUp, keyPress for every character in the specified string;
  716. * this is useful for dynamic UI widgets (like auto-completing combo boxes) that require explicit key events.
  717. * </p><p>
  718. * Unlike the simple "type" command, which forces the specified value into the page directly, this command
  719. * may or may not have any visible effect, even in cases where typing keys would normally have a visible effect.
  720. * For example, if you use "typeKeys" on a form element, you may or may not see the results of what you typed in
  721. * the field.
  722. * </p><p>
  723. * In some cases, you may need to use the simple "type" command to set the value of the field and then the "typeKeys" command to
  724. * send the keystroke events corresponding to what you just typed.
  725. * </p>
  726. *
  727. * @access public
  728. * @param string $locator an element locator
  729. * @param string $value the value to type
  730. */
  731. public function typeKeys($locator, $value)
  732. {
  733. $this->doCommand("typeKeys", array($locator, $value));
  734. }
  735. /**
  736. * Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation). By default, there is no such delay, i.e.,
  737. * the delay is 0 milliseconds.
  738. *
  739. * @access public
  740. * @param string $value the number of milliseconds to pause after operation
  741. */
  742. public function setSpeed($value)
  743. {
  744. $this->doCommand("setSpeed", array($value));
  745. }
  746. /**
  747. * Get execution speed (i.e., get the millisecond length of the delay following each selenium operation). By default, there is no such delay, i.e.,
  748. * the delay is 0 milliseconds.
  749. *
  750. * See also setSpeed.
  751. *
  752. * @access public
  753. * @return string the execution speed in milliseconds.
  754. */
  755. public function getSpeed()
  756. {
  757. return $this->getString("getSpeed", array());
  758. }
  759. /**
  760. * Check a toggle-button (checkbox/radio)
  761. *
  762. * @access public
  763. * @param string $locator an element locator
  764. */
  765. public function check($locator)
  766. {
  767. $this->doCommand("check", array($locator));
  768. }
  769. /**
  770. * Uncheck a toggle-button (checkbox/radio)
  771. *
  772. * @access public
  773. * @param string $locator an element locator
  774. */
  775. public function uncheck($locator)
  776. {
  777. $this->doCommand("uncheck", array($locator));
  778. }
  779. /**
  780. * Select an option from a drop-down using an option locator.
  781. *
  782. * <p>
  783. *
  784. * Option locators provide different ways of specifying options of an HTML
  785. * Select element (e.g. for selecting a specific option, or for asserting
  786. * that the selected option satisfies a specification). There are several
  787. * forms of Select Option Locator.
  788. *
  789. * </p>
  790. * <ul>
  791. *
  792. * <li>
  793. * <b>label</b>=<i>labelPattern</i>:
  794. * matches options based on their labels, i.e. the visible text. (This
  795. * is the default.)
  796. *
  797. * <ul>
  798. *
  799. * <li>
  800. * label=regexp:^[Oo]ther
  801. * </li>
  802. * </ul>
  803. * </li>
  804. * <li>
  805. * <b>value</b>=<i>valuePattern</i>:
  806. * matches options based on their values.
  807. *
  808. * <ul>
  809. *
  810. * <li>
  811. * value=other
  812. * </li>
  813. * </ul>
  814. * </li>
  815. * <li>
  816. * <b>id</b>=<i>id</i>:
  817. *
  818. * matches options based on their ids.
  819. *
  820. * <ul>
  821. *
  822. * <li>
  823. * id=option1
  824. * </li>
  825. * </ul>
  826. * </li>
  827. * <li>
  828. * <b>index</b>=<i>index</i>:
  829. * matches an option based on its index (offset from zero).
  830. *
  831. * <ul>
  832. *
  833. * <li>
  834. * index=2
  835. * </li>
  836. * </ul>
  837. * </li>
  838. * </ul><p>
  839. *
  840. * If no option locator prefix is provided, the default behaviour is to match on <b>label</b>.
  841. *
  842. * </p>
  843. *
  844. * @access public
  845. * @param string $selectLocator an element locator identifying a drop-down menu
  846. * @param string $optionLocator an option locator (a label by default)
  847. */
  848. public function select($selectLocator, $optionLocator)
  849. {
  850. $this->doCommand("select", array($selectLocator, $optionLocator));
  851. }
  852. /**
  853. * Add a selection to the set of selected options in a multi-select element using an option locator.
  854. *
  855. * @see #doSelect for details of option locators
  856. *
  857. * @access public
  858. * @param string $locator an element locator identifying a multi-select box
  859. * @param string $optionLocator an option locator (a label by default)
  860. */
  861. public function addSelection($locator, $optionLocator)
  862. {
  863. $this->doCommand("addSelection", array($locator, $optionLocator));
  864. }
  865. /**
  866. * Remove a selection from the set of selected options in a multi-select element using an option locator.
  867. *
  868. * @see #doSelect for details of option locators
  869. *
  870. * @access public
  871. * @param string $locator an element locator identifying a multi-select box
  872. * @param string $optionLocator an option locator (a label by default)
  873. */
  874. public function removeSelection($locator, $optionLocator)
  875. {
  876. $this->doCommand("removeSelection", array($locator, $optionLocator));
  877. }
  878. /**
  879. * Unselects all of the selected options in a multi-select element.
  880. *
  881. * @access public
  882. * @param string $locator an element locator identifying a multi-select box
  883. */
  884. public function removeAllSelections($locator)
  885. {
  886. $this->doCommand("removeAllSelections", array($locator));
  887. }
  888. /**
  889. * Submit the specified form. This is particularly useful for forms without
  890. * submit buttons, e.g. single-input "Search" forms.
  891. *
  892. * @access public
  893. * @param string $formLocator an element locator for the form you want to submit
  894. */
  895. public function submit($formLocator)
  896. {
  897. $this->doCommand("submit", array($formLocator));
  898. }
  899. /**
  900. * Opens an URL in the test frame. This accepts both relative and absolute
  901. * URLs.
  902. *
  903. * The "open" command waits for the page to load before proceeding,
  904. * ie. the "AndWait" suffix is implicit.
  905. *
  906. * <i>Note</i>: The URL must be on the same domain as the runner HTML
  907. * due to security restrictions in the browser (Same Origin Policy). If you
  908. * need to open an URL on another domain, use the Selenium Server to start a
  909. * new browser session on that domain.
  910. *
  911. * @access public
  912. * @param string $url the URL to open; may be relative or absolute
  913. */
  914. public function open($url)
  915. {
  916. $this->doCommand("open", array($url));
  917. }
  918. /**
  919. * Opens a popup window (if a window with that ID isn't already open).
  920. * After opening the window, you'll need to select it using the selectWindow
  921. * command.
  922. *
  923. * <p>
  924. * This command can also be a useful workaround for bug SEL-339. In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example).
  925. * In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using
  926. * an empty (blank) url, like this: openWindow("", "myFunnyWindow").
  927. * </p>
  928. *
  929. * @access public
  930. * @param string $url the URL to open, which can be blank
  931. * @param string $windowID the JavaScript window ID of the window to select
  932. */
  933. public function openWindow($url, $windowID)
  934. {
  935. $this->doCommand("openWindow", array($url, $windowID));
  936. }
  937. /**
  938. * Selects a popup window using a window locator; once a popup window has been selected, all
  939. * commands go to that window. To select the main window again, use null
  940. * as the target.
  941. *
  942. * <p>
  943. *
  944. *
  945. * Window locators provide different ways of specifying the window object:
  946. * by title, by internal JavaScript "name," or by JavaScript variable.
  947. *
  948. * </p>
  949. * <ul>
  950. *
  951. * <li>
  952. * <b>title</b>=<i>My Special Window</i>:
  953. * Finds the window using the text that appears in the title bar. Be careful;
  954. * two windows can share the same title. If that happens, this locator will
  955. * just pick one.
  956. *
  957. * </li>
  958. * <li>
  959. * <b>name</b>=<i>myWindow</i>:
  960. * Finds the window using its internal JavaScript "name" property. This is the second
  961. * parameter "windowName" passed to the JavaScript method window.open(url, windowName, windowFeatures, replaceFlag)
  962. * (which Selenium intercepts).
  963. *
  964. * </li>
  965. * <li>
  966. * <b>var</b>=<i>variableName</i>:
  967. * Some pop-up windows are unnamed (anonymous), but are associated with a JavaScript variable name in the current
  968. * application window, e.g. "window.foo = window.open(url);". In those cases, you can open the window using
  969. * "var=foo".
  970. *
  971. * </li>
  972. * </ul><p>
  973. *
  974. * If no window locator prefix is provided, we'll try to guess what you mean like this:
  975. * </p><p>
  976. * 1.) if windowID is null, (or the string "null") then it is assumed the user is referring to the original window instantiated by the browser).
  977. * </p><p>
  978. * 2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed
  979. * that this variable contains the return value from a call to the JavaScript window.open() method.
  980. * </p><p>
  981. * 3.) Otherwise, selenium looks in a hash it maintains that maps string names to window "names".
  982. * </p><p>
  983. * 4.) If <i>that</i> fails, we'll try looping over all of the known windows to try to find the appropriate "title".
  984. * Since "title" is not necessarily unique, this may have unexpected behavior.
  985. * </p><p>
  986. * If you're having trouble figuring out the name of a window that you want to manipulate, look at the Selenium log messages
  987. * which identify the names of windows created via window.open (and therefore intercepted by Selenium). You will see messages
  988. * like the following for each window as it is opened:
  989. * </p><p>
  990. * <code>debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"</code>
  991. * </p><p>
  992. * In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example).
  993. * (This is bug SEL-339.) In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using
  994. * an empty (blank) url, like this: openWindow("", "myFunnyWindow").
  995. * </p>
  996. *
  997. * @access public
  998. * @param string $windowID the JavaScript window ID of the window to select
  999. */
  1000. public function selectWindow($windowID)
  1001. {
  1002. $this->doCommand("selectWindow", array($windowID));
  1003. }
  1004. /**
  1005. * Selects a frame within the current window. (You may invoke this command
  1006. * multiple times to select nested frames.) To select the parent frame, use
  1007. * "relative=parent" as a locator; to select the top frame, use "relative=top".
  1008. * You can also select a frame by its 0-based index number; select the first frame with
  1009. * "index=0", or the third frame with "index=2".
  1010. *
  1011. * <p>
  1012. * You may also use a DOM expression to identify the frame you want directly,
  1013. * like this: <code>dom=frames["main"].frames["subframe"]</code>
  1014. * </p>
  1015. *
  1016. * @access public
  1017. * @param string $locator an element locator identifying a frame or iframe
  1018. */
  1019. public function selectFrame($locator)
  1020. {
  1021. $this->doCommand("selectFrame", array($locator));
  1022. }
  1023. /**
  1024. * Determine whether current/locator identify the frame containing this running code.
  1025. *
  1026. * <p>
  1027. * This is useful in proxy injection mode, where this code runs in every
  1028. * browser frame and window, and sometimes the selenium server needs to identify
  1029. * the "current" frame. In this case, when the test calls selectFrame, this
  1030. * routine is called for each frame to figure out which one has been selected.
  1031. * The selected frame will return true, while all others will return false.
  1032. * </p>
  1033. *
  1034. * @access public
  1035. * @param string $currentFrameString starting frame
  1036. * @param string $target new frame (which might be relative to the current one)
  1037. * @return boolean true if the new frame is this code's window
  1038. */
  1039. public function getWhetherThisFrameMatchFrameExpression($currentFrameString, $target)
  1040. {
  1041. return $this->getBoolean("getWhetherThisFrameMatchFrameExpression", array($currentFrameString, $target));
  1042. }
  1043. /**
  1044. * Determine whether currentWindowString plus target identify the window containing this running code.
  1045. *
  1046. * <p>
  1047. * This is useful in proxy injection mode, where this code runs in every
  1048. * browser frame and window, and sometimes the selenium server needs to identify
  1049. * the "current" window. In this case, when the test calls selectWindow, this
  1050. * routine is called for each window to figure out which one has been selected.
  1051. * The selected window will return true, while all others will return false.
  1052. * </p>
  1053. *
  1054. * @access public
  1055. * @param string $currentWindowString starting window
  1056. * @param string $target new window (which might be relative to the current one, e.g., "_parent")
  1057. * @return boolean true if the new window is this code's window
  1058. */
  1059. public function getWhetherThisWindowMatchWindowExpression($currentWindowString, $target)
  1060. {
  1061. return $this->getBoolean("getWhetherThisWindowMatchWindowExpression", array($currentWindowString, $target));
  1062. }
  1063. /**
  1064. * Waits for a popup window to appear and load up.
  1065. *
  1066. * @access public
  1067. * @param string $windowID the JavaScript window "name" of the window that will appear (not the text of the title bar)
  1068. * @param string $timeout a timeout in milliseconds, after which the action will return with an error
  1069. */
  1070. public function waitForPopUp($windowID, $timeout)
  1071. {
  1072. $this->doCommand("waitForPopUp", array($windowID, $timeout));
  1073. }
  1074. /**
  1075. * <p>
  1076. *
  1077. * By default, Selenium's overridden window.confirm() function will
  1078. * return true, as if the user had manually clicked OK; after running
  1079. * this command, the next call to confirm() will return false, as if
  1080. * the user had clicked Cancel. Selenium will then resume using the
  1081. * default behavior for future confirmations, automatically returning
  1082. * true (OK) unless/until you explicitly call this command for each
  1083. * confirmation.
  1084. *
  1085. * </p><p>
  1086. *
  1087. * Take note - every time a confirmation comes up, you must
  1088. * consume it with a corresponding getConfirmation, or else
  1089. * the next selenium operation will fail.
  1090. *
  1091. * </p>
  1092. *
  1093. * @access public
  1094. */
  1095. public function chooseCancelOnNextConfirmation()
  1096. {
  1097. $this->doCommand("chooseCancelOnNextConfirmation", array());
  1098. }
  1099. /**
  1100. * <p>
  1101. *
  1102. * Undo the effect of calling chooseCancelOnNextConfirmation. Note
  1103. * that Selenium's overridden window.confirm() function will normally automatically
  1104. * return true, as if the user had manually clicked OK, so you shouldn't
  1105. * need to use this command unless for some reason you need to change
  1106. * your mind prior to the next confirmation. After any confirmation, Selenium will resume using the
  1107. * default behavior for future confirmations, automatically returning
  1108. * true (OK) unless/until you explicitly call chooseCancelOnNextConfirmation for each
  1109. * confirmation.
  1110. *
  1111. * </p><p>
  1112. *
  1113. * Take note - every time a confirmation comes up, you must
  1114. * consume it with a corresponding getConfirmation, or else
  1115. * the next selenium operation will fail.
  1116. *
  1117. * </p>
  1118. *
  1119. * @access public
  1120. */
  1121. public function chooseOkOnNextConfirmation()
  1122. {
  1123. $this->doCommand("chooseOkOnNextConfirmation", array());
  1124. }
  1125. /**
  1126. * Instructs Selenium to return the specified answer string in response to
  1127. * the next JavaScript prompt [window.prompt()].
  1128. *
  1129. * @access public
  1130. * @param string $answer the answer to give in response to the prompt pop-up
  1131. */
  1132. public function answerOnNextPrompt($answer)
  1133. {
  1134. $this->doCommand("answerOnNextPrompt", array($answer));
  1135. }
  1136. /**
  1137. * Simulates the user clicking the "back" button on their browser.
  1138. *
  1139. * @access public
  1140. */
  1141. public function goBack()
  1142. {
  1143. $this->doCommand("goBack", array());
  1144. }
  1145. /**
  1146. * Simulates the user clicking the "Refresh" button on their browser.
  1147. *
  1148. * @access public
  1149. */
  1150. public function refresh()
  1151. {
  1152. $this->doCommand("refresh", array());
  1153. }
  1154. /**
  1155. * Simulates the user clicking the "close" button in the titlebar of a popup
  1156. * window or tab.
  1157. *
  1158. * @access public
  1159. */
  1160. public function close()
  1161. {
  1162. $this->doCommand("close", array());
  1163. }
  1164. /**
  1165. * Has an alert occurred?
  1166. *
  1167. * <p>
  1168. *
  1169. * This function never throws an exception
  1170. *
  1171. * </p>
  1172. *
  1173. * @access public
  1174. * @return boolean true if there is an alert
  1175. */
  1176. public function isAlertPresent()
  1177. {
  1178. return $this->getBoolean("isAlertPresent", array());
  1179. }
  1180. /**
  1181. * Has a prompt occurred?
  1182. *
  1183. * <p>
  1184. *
  1185. * This function never throws an exception
  1186. *
  1187. * </p>
  1188. *
  1189. * @access public
  1190. * @return boolean true if there is a pending prompt
  1191. */
  1192. public function isPromptPresent()
  1193. {
  1194. return $this->getBoolean("isPromptPresent", array());
  1195. }
  1196. /**
  1197. * Has confirm() been called?
  1198. *
  1199. * <p>
  1200. *
  1201. * This function never throws an exception
  1202. *
  1203. * </p>
  1204. *
  1205. * @access public
  1206. * @return boolean true if there is a pending confirmation
  1207. */
  1208. public function isConfirmationPresent()
  1209. {
  1210. return $this->getBoolean("isConfirmationPresent", array());
  1211. }
  1212. /**
  1213. * Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.
  1214. *
  1215. * <p>
  1216. * Getting an alert has the same effect as manually clicking OK. If an
  1217. * alert is generated but you do not consume it with getAlert, the next Selenium action
  1218. * will fail.
  1219. * </p><p>
  1220. * Under Selenium, JavaScript alerts will NOT pop up a visible alert
  1221. * dialog.
  1222. * </p><p>
  1223. * Selenium does NOT support JavaScript alerts that are generated in a
  1224. * page's onload() event handler. In this case a visible dialog WILL be
  1225. * generated and Selenium will hang until someone manually clicks OK.
  1226. * </p>
  1227. *
  1228. * @access public
  1229. * @return string The message of the most recent JavaScript alert
  1230. */
  1231. public function getAlert()
  1232. {
  1233. return $this->getString("getAlert", array());
  1234. }
  1235. /**
  1236. * Retrieves the message of a JavaScript confirmation dialog generated during
  1237. * the previous action.
  1238. *
  1239. * <p>
  1240. *
  1241. * By default, the confirm function will return true, having the same effect
  1242. * as manually clicking OK. This can be changed by prior execution of the
  1243. * chooseCancelOnNextConfirmation command.
  1244. *
  1245. * </p><p>
  1246. *
  1247. * If an confirmation is generated but you do not consume it with getConfirmation,
  1248. * the next Selenium action will fail.
  1249. *
  1250. * </p><p>
  1251. *
  1252. * NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible
  1253. * dialog.
  1254. *
  1255. * </p><p>
  1256. *
  1257. * NOTE: Selenium does NOT support JavaScript confirmations that are
  1258. * generated in a page's onload() event handler. In this case a visible
  1259. * dialog WILL be generated and Selenium will hang until you manually click
  1260. * OK.
  1261. *
  1262. * </p>
  1263. *
  1264. * @access public
  1265. * @return string the message of the most recent JavaScript confirmation dialog
  1266. */
  1267. public function getConfirmation()
  1268. {
  1269. return $this->getString("getConfirmation", array());
  1270. }
  1271. /**
  1272. * Retrieves the message of a JavaScript question prompt dialog generated during
  1273. * the previous action.
  1274. *
  1275. * <p>
  1276. * Successful handling of the prompt requires prior execution of the
  1277. * answerOnNextPrompt command. If a prompt is generated but you
  1278. * do not get/verify it, the next Selenium action will fail.
  1279. * </p><p>
  1280. * NOTE: under Selenium, JavaScript prompts will NOT pop up a visible
  1281. * dialog.
  1282. * </p><p>
  1283. * NOTE: Selenium does NOT support JavaScript prompts that are generated in a
  1284. * page's onload() event handler. In this case a visible dialog WILL be
  1285. * generated and Selenium will hang until someone manually clicks OK.
  1286. * </p>
  1287. *
  1288. * @access public
  1289. * @return string the message of the most recent JavaScript question prompt
  1290. */
  1291. public function getPrompt()
  1292. {
  1293. return $this->getString("getPrompt", array());
  1294. }
  1295. /**
  1296. * Gets the absolute URL of the current page.
  1297. *
  1298. * @access public
  1299. * @return string the absolute URL of the current page
  1300. */
  1301. public function getLocation()
  1302. {
  1303. return $this->getString("getLocation", array());
  1304. }
  1305. /**
  1306. * Gets the title of the current page.
  1307. *
  1308. * @access public
  1309. * @return string the title of the current page
  1310. */
  1311. public function getTitle()
  1312. {
  1313. return $this->getString("getTitle", array());
  1314. }
  1315. /**
  1316. * Gets the entire text of the page.
  1317. *
  1318. * @access public
  1319. * @return string the entire text of the page
  1320. */
  1321. public function getBodyText()
  1322. {
  1323. return $this->getString("getBodyText", array());
  1324. }
  1325. /**
  1326. * Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter).
  1327. * For checkbox/radio elements, the value will be "on" or "off" depending on
  1328. * whether the element is checked or not.
  1329. *
  1330. * @access public
  1331. * @param string $locator an element locator
  1332. * @return string the element value, or "on/off" for checkbox/radio elements
  1333. */
  1334. public function getValue($locator)
  1335. {
  1336. return $this->getString("getValue", array($locator));
  1337. }
  1338. /**
  1339. * Gets the text of an element. This works for any element that contains
  1340. * text. This command uses either the textContent (Mozilla-like browsers) or
  1341. * the innerText (IE-like browsers) of the element, which is the rendered
  1342. * text shown to the user.
  1343. *
  1344. * @access public
  1345. * @param string $locator an element locator
  1346. * @return string the text of the element
  1347. */
  1348. public function getText($locator)
  1349. {
  1350. return $this->getString("getText", array($locator));
  1351. }
  1352. /**
  1353. * Briefly changes the backgroundColor of the specified element yellow. Useful for debugging.
  1354. *
  1355. * @access public
  1356. * @param string $locator an element locator
  1357. */
  1358. public function highlight($locator)
  1359. {
  1360. $this->doCommand("highlight", array($locator));
  1361. }
  1362. /**
  1363. * Gets the result of evaluating the specified JavaScript snippet. The snippet may
  1364. * have multiple lines, but only the result of the last line will be returned.
  1365. *
  1366. * <p>
  1367. * Note that, by default, the snippet will run in the context of the "selenium"
  1368. * object itself, so <code>this</code> will refer to the Selenium object. Use <code>window</code> to
  1369. * refer to the window of your application, e.g. <code>window.document.getElementById('foo')</code>
  1370. * </p><p>
  1371. * If you need to use
  1372. * a locator to refer to a single element in your application page, you can
  1373. * use <code>this.browserbot.findElement("id=foo")</code> where "id=foo" is your locator.
  1374. * </p>
  1375. *
  1376. * @access public
  1377. * @param string $script the JavaScript snippet to run
  1378. * @return string the results of evaluating the snippet
  1379. */
  1380. public function getEval($script)
  1381. {
  1382. return $this->getString("getEval", array($script));
  1383. }
  1384. /**
  1385. * Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn't exist or isn't a toggle-button.
  1386. *
  1387. * @access public
  1388. * @param string $locator an element locator pointing to a checkbox or radio button
  1389. * @return boolean true if the checkbox is checked, false otherwise
  1390. */
  1391. public function isChecked($locator)
  1392. {
  1393. return $this->getBoolean("isChecked", array($locator));
  1394. }
  1395. /**
  1396. * Gets the text from a cell of a table. The cellAddress syntax
  1397. * tableLocator.row.column, where row and column start at 0.
  1398. *
  1399. * @access public
  1400. * @param string $tableCellAddress a cell address, e.g. "foo.1.4"
  1401. * @return string the text from the specified cell
  1402. */
  1403. public function getTable($tableCellAddress)
  1404. {
  1405. return $this->getString("getTable", array($tableCellAddress));
  1406. }
  1407. /**
  1408. * Gets all option labels (visible text) for selected options in the specified select or multi-select element.
  1409. *
  1410. * @access public
  1411. * @param string $selectLocator an element locator identifying a drop-down menu
  1412. * @return array an array of all selected option labels in the specified select drop-down
  1413. */
  1414. public function getSelectedLabels($selectLocator)
  1415. {
  1416. return $this->getStringArray("getSelectedLabels", array($selectLocator));
  1417. }
  1418. /**
  1419. * Gets option label (visible text) for selected option in the specified select element.
  1420. *
  1421. * @access public
  1422. * @param string $selectLocator an element locator identifying a drop-down menu
  1423. * @return string the selected option label in the specified select drop-down
  1424. */
  1425. public function getSelectedLabel($selectLocator)
  1426. {
  1427. return $this->getString("getSelectedLabel", array($selectLocator));
  1428. }
  1429. /**
  1430. * Gets all option values (value attributes) for selected options in the specified select or multi-select element.
  1431. *
  1432. * @access public
  1433. * @param string $selectLocator an element locator identifying a drop-down menu
  1434. * @return array an array of all selected option values in the specified select drop-down
  1435. */
  1436. public function getSelectedValues($selectLocator)
  1437. {
  1438. return $this->getStringArray("getSelectedValues", array($selectLocator));
  1439. }
  1440. /**
  1441. * Gets option value (value attribute) for selected option in the specified select element.
  1442. *
  1443. * @access public
  1444. * @param string $selectLocator an element locator identifying a drop-down menu
  1445. * @return string the selected option value in the specified select drop-down
  1446. */
  1447. public function getSelectedValue($selectLocator)
  1448. {
  1449. return $this->getString("getSelectedValue", array($selectLocator));
  1450. }
  1451. /**
  1452. * Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element.
  1453. *
  1454. * @access public
  1455. * @param string $selectLocator an element locator identifying a drop-down menu
  1456. * @return array an array of all selected option indexes in the specified select drop-down
  1457. */
  1458. public function getSelectedIndexes($selectLocator)
  1459. {
  1460. return $this->getStringArray("getSeā€¦

Large files files are truncated, but you can click here to view the full file