Open ldt0589 opened 2 years ago
afaik Open.browserOn()
is for giving you a fluent API when using Page Objects Open.browserOn().the(...)
. There are different ways to definde the url of a page, see https://serenity-bdd.github.io/theserenitybook/latest/page-objects.html#_opening_the_page
Open.url
and relativeUrl
do what it says. They will open a url (using webdriver.get). One takes an absolute url, the other one relative to the current url.
afaik
Open.browserOn()
is for giving you a fluent API when using Page ObjectsOpen.browserOn().the(...)
. There are different ways to definde the url of a page, see https://serenity-bdd.github.io/theserenitybook/latest/page-objects.html#_opening_the_pageOpen.url
andrelativeUrl
do what it says. They will open a url (using webdriver.get). One takes an absolute url, the other one relative to the current url.
Thanks for answer. Could you give the more detail for relativeUrl. How to use this method ?
given you are on https://example.com/
you could open Open.url("https://example.com/about/")
or Open.relativeUrl("about/")
to achieve the same thing
You can also move upwards the path. like given you are on https://www.iana.org/domains/root
, and open relative url ../reserved
, the resulting url would be https://www.iana.org/domains/reserved
given you are on
https://example.com/
you could openOpen.url("https://example.com/about/")
orOpen.relativeUrl("about/")
to achieve the same thingYou can also move upwards the path. like given you are on
https://www.iana.org/domains/root
, and open relative url../reserved
, the resulting url would behttps://www.iana.org/domains/reserved
So using Open.relativeUrl("about/") to open page. But i don't know how to call the host https://example.com OR where do we save host?
check https://serenity-bdd.github.io/theserenitybook/latest/page-objects.html#_opening_the_page @DefaultUrl
or just hard code the host public static String HOST = "https://example.com"
I use Serenity-screenplay-webdriver 3.1.1 I see that Open class has a lot method like: ` public static OpenPage browserOn(PageObject targetPage) { return new OpenPage(targetPage); }
I'm confused about methods. Could you tell me the differentce of methods:
Thanks in advance