Open contactkrsna1 opened 4 years ago
The code you have here will behave identically in Serenity and Selenium
Acually i want to use getAlert().accept(); and then move to main window. How this is done using serenity api
Serenity just wraps Selenium, so you would do the same as in Selenium
Hi, Oops , i did a lot of research on Serenity and I liked it. But I am not able to reach my goal
I have a feature file with 2 scenarios Scenario 1
Now here, I am getting an error saying that "org.openqa.selenium.NoSuchWindowException: no such window: target window already closed" and none of the elements are found.
Thanks In Advance
How would you do it with Selenium?
Hi, in selenium we use get/navigate method
But for serenity approach below is the code
In the second scenario,
@Steps
DeeplinkStep deeplinksteps;
@Given("I am on the deep link page")
public void deeplink() {
deeplinksteps.open();
}
DeeplinkStep
DeeplinkPage deeplinkPage;
@Step
public void open() {
deeplinkPage.open();
}
Deeplink page object
@NamedUrls( { @NamedUrl(name = "page", url = "http://localhost:8080/editor.html/{1}") } ) public class Deeplink extends PageObject {
public void open() {
open("page", withParameters("index.html"));
}
You can use getDriver() inside a PageObject or UIStepInteraction class for this
Hi, How to achieve the below lines using serenity getDriver().switchTo().alert().accept(); getDriver().switchTo().defaultContent();
Thanks in Advance