@@ -670,10 +670,6 @@ public function executeScript(
670670 $ this ->getWebDriver ()->executeScript ($ script );
671671 }
672672
673- /**
674- * {@inheritdoc}
675- * @return mixed
676- */
677673 public function evaluateScript (
678674 #[Language('JavaScript ' )]
679675 string $ script
@@ -971,7 +967,7 @@ private function executeJsOnXpath(
971967 * @throws DriverException
972968 */
973969 private function executeJsOnElement (
974- RemoteWebElement $ element ,
970+ WebDriverElement $ element ,
975971 #[Language('JavaScript ' )]
976972 string $ script
977973 ) {
@@ -1044,7 +1040,7 @@ private function getWindowHandleFromName(string $name): string
10441040 }
10451041 }
10461042
1047- private function clickOnElement (RemoteWebElement $ element ): void
1043+ private function clickOnElement (WebDriverElement $ element ): void
10481044 {
10491045 $ element ->getLocationOnScreenOnceScrolledIntoView ();
10501046 $ element ->click ();
@@ -1108,14 +1104,11 @@ private function withWindow(?string $name, callable $callback): void
11081104 */
11091105 private function findElement (
11101106 #[Language('XPath ' )]
1111- string $ xpath ,
1112- ?RemoteWebElement $ parent = null
1107+ string $ xpath
11131108 ): RemoteWebElement {
11141109 try {
11151110 $ finder = WebDriverBy::xpath ($ xpath );
1116- return $ parent
1117- ? $ parent ->findElement ($ finder )
1118- : $ this ->getWebDriver ()->findElement ($ finder );
1111+ return $ this ->getWebDriver ()->findElement ($ finder );
11191112 } catch (\Throwable $ e ) {
11201113 throw new DriverException ("Failed to find element: {$ e ->getMessage ()}" , 0 , $ e );
11211114 }
@@ -1124,7 +1117,7 @@ private function findElement(
11241117 /**
11251118 * @throws DriverException
11261119 */
1127- private function selectRadioValue (RemoteWebElement $ element , string $ value ): void
1120+ private function selectRadioValue (WebDriverElement $ element , string $ value ): void
11281121 {
11291122 try {
11301123 (new WebDriverRadios ($ element ))->selectByValue ($ value );
@@ -1142,7 +1135,7 @@ private function selectRadioValue(RemoteWebElement $element, string $value): voi
11421135 /**
11431136 * @throws DriverException
11441137 */
1145- private function selectOptionOnElement (RemoteWebElement $ element , string $ value , bool $ multiple = false ): void
1138+ private function selectOptionOnElement (WebDriverElement $ element , string $ value , bool $ multiple = false ): void
11461139 {
11471140 try {
11481141 $ select = new WebDriverSelect ($ element );
@@ -1172,7 +1165,7 @@ private function selectOptionOnElement(RemoteWebElement $element, string $value,
11721165 *
11731166 * @throws DriverException
11741167 */
1175- private function deselectAllOptions (RemoteWebElement $ element ): void
1168+ private function deselectAllOptions (WebDriverElement $ element ): void
11761169 {
11771170 try {
11781171 (new WebDriverSelect ($ element ))->deselectAll ();
@@ -1190,7 +1183,7 @@ private function deselectAllOptions(RemoteWebElement $element): void
11901183 * @throws DriverException
11911184 */
11921185 private function ensureInputType (
1193- RemoteWebElement $ element ,
1186+ WebDriverElement $ element ,
11941187 #[Language('XPath ' )]
11951188 string $ xpath ,
11961189 string $ type ,
@@ -1233,7 +1226,7 @@ private function jsonEncode($value, string $action, string $field): string
12331226 * @param mixed $value
12341227 * @throws DriverException
12351228 */
1236- private function setElementDomProperty (RemoteWebElement $ element , string $ property , $ value ): void
1229+ private function setElementDomProperty (WebDriverElement $ element , string $ property , $ value ): void
12371230 {
12381231 $ this ->executeJsOnElement (
12391232 $ element ,
0 commit comments