Skip to content

Commit 6e4fbe3

Browse files
authored
Merge pull request #39 from beneite/feature
adding scrollElement action
2 parents a75b8d3 + ed86c0a commit 6e4fbe3

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/main/java/com/asismisr/pages/BasePage.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.asismisr.utils.extentreport.ExtentReportLogger;
1010
import org.openqa.selenium.By;
1111
import org.openqa.selenium.WebElement;
12+
import org.openqa.selenium.interactions.Actions;
1213
import org.openqa.selenium.support.ui.Select;
1314
import org.openqa.selenium.support.ui.WebDriverWait;
1415
import org.slf4j.Logger;
@@ -94,4 +95,13 @@ protected void sendElementWithWait(By by, String textToField, WaitStrategyEnums
9495
ExtentReportLogger.info(by.toString()+" Text Entered is "+ textToField);
9596
log.info("{} Text Entered is {}", by.toString(), textToField);
9697
}
98+
99+
protected void scrollToElement(By by)
100+
{
101+
Actions actions=new Actions(DriverManager.getWebDriverFromThreadLocal());
102+
WebElement element=DriverManager.getWebDriverFromThreadLocal().findElement(by);
103+
actions.scrollToElement(element).perform();
104+
ExtentReportLogger.info("Element Scrolled:"+ by.toString());
105+
log.info("{} Element Scrolled", by.toString());
106+
}
97107
}

src/main/java/com/asismisr/pages/flightRegistration/flightSelection/FlightSelectionPage.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public void selectFlights(){
2525
}
2626

2727
public void confirmFlights(){
28+
scrollToElement(CONFIRM_FLIGHTS_BUTTON);
2829
clickElement(CONFIRM_FLIGHTS_BUTTON);
2930
}
3031
}

0 commit comments

Comments
 (0)