【发布时间】:2020-05-28 07:46:22
【问题描述】:
我有一项任务需要自动化 booking.com 页面,其中一项任务是选择入住和退房日期。我怎么能做到这一点?我自动化了,我可以打开日历,,但我不知道如何选择日期。
这是我的代码 黄瓜步
And user selects dates from "2020-06-16" to "2020-06-26"
预订步骤
When('user selects dates from {string} to {string}',()=>{
BookingPage.checkInOut.click();
browser.debug(); });
预订页面
class BookingPage{
get whereAreYouGoingTextBox(){return $('#ss')};
get checkInOut(){return $('div.xp__dates-inner')}; }export default new BookingPage();
【问题讨论】:
-
你能检查日期吗?
-
是的,我可以检查日期
-
尝试点击日期并生成动态 xpath。因此,您可以将日期作为参数传递并单击任何日期
-
我可以在没有 xpath 的情况下做到这一点吗?只使用 css?
标签: javascript selenium-webdriver cucumber webdriver-io