- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
可用天数有一个类.calendarCellOpen
:
table.calendario .calendarCellOpen input {
}
这是日历 css:
#calwrapper
{
min-height:230px;
margin-top:10px;
}
#calendar
{
float:left;
margin-left: 15px; /*Daniele 10-04-2014*/
}
span.calendario
{
display:block;
margin:0;
}
table.fasce
{
margin-left:20px;
}
table.fasce th
{
background-image: url( '../images/tab_body.png' );
background-repeat: repeat-x;
font-size:12px;
}
table.fasce tr
{
border-bottom: #f5f4e7 thin dotted;
}
table.calendario
{
border-top: 0px !important;
}
table.calendario, table.fasce
{
width: 300px;
background-color: White !important;
font-size: 15px;
border-right: #f5f4e7 1px solid !important;
border-left: #f5f4e7 1px solid !important;
border-bottom: #f5f4e7 1px solid !important;
}
table.calendario td, table.fasce td
{
text-align:center;
}
table.calendario .calTitolo
{
background-image: url( '../images/tab_body.png' );
background-repeat: repeat-x;
margin: 0px !important;
padding: 0px !important;
font-size:12px;
}
table.calendario .calTitolo td
{
padding:0px 5px 0px 5px;
width:14.3%;
}
table.calendario .calDayHeader /* RIGA */
{
background-color:#FCFBF7;
font-size:12px;
}
table.calendario .otherMonthDay
{
color: #C0C0C0;
}
table.calendario .cellaSelezionata /* CELLA */
{
background-color:#EDEBD5 !important;
border-collapse:collapse !important;
font-weight:bold;
}
table.calendario .calendarCellOpen input
{
color:#208020 !important; /*High availability (green)*/
font-weight:bold;
}
table.calendario .calendarCellRed
{
color:Red !important; /*noe availability*/
font-weight:bold;
}
table.calendario .calendarCellMed input
{
color:#F09643 !important; /*Disponibilità media*/
font-weight:bold;
}
.pulsanteCalendario
{
border: 0px;
background-color: Transparent;
cursor: pointer;
padding: 0px 0px 0px 0px;
margin: 0px;
height:20px;
width:100%;
overflow:visible;
text-align:center;
font-size:16px;
}
.pulsanteCalendario:hover
{
text-decoration:underline;
}
#legend
{
margin-bottom:8px;
width:100%;
}
#legend ul
{
list-style-type:none;
}
#legend ul li
{
display:inline;
margin-left:20px;
}
问题是我想选择(用 Selenium 单击它)可用的日期(哪一天无关紧要)。任何看起来可用的日期(绿色)。
这是日历:
elementos = driver.find_elements_by_class_name("calendarCellOpen")
while True:
if elementos:
driver.find_element_by_class_name("calendarCellOpen").click()
driver.find_element_by_id("ctl00_ContentPlaceHolder1_acc_Calendario1_repFasce_ctl01_btnConferma").click() #confirm button
else:
driver.find_element_by_xpath("//input[@value='<']").click() #back
if elementos:
driver.find_element_by_class_name("calendarCellOpen").click()
driver.find_element_by_id("ctl00_ContentPlaceHolder1_acc_Calendario1_repFasce_ctl01_btnConferma").click()
driver.find_element_by_xpath("//input[@value='>']").click() #forward
if elementos:
driver.find_element_by_class_name("calendarCellOpen").click()
driver.find_element_by_id("ctl00_ContentPlaceHolder1_acc_Calendario1_repFasce_ctl01_btnConferma").click()
这是我写的一些代码
我来来回回因为这是重新加载日历的唯一方法..
这是日历的 HTML:
<div id="calwrapper">
<div id="legend" style="padding-left:15px; margin-bottom:20px">
<table style="width:90%; border-collapse:collapse; border: 0px">
<tr style="line-height:15px">
<td style="background-color:Red; width:80px; margin-right:10px">
</td>
<td style="width: 383px; padding-left:5px">
Tutto occupato # all none available
</td>
<td style="background-color:#F09643; width:80px">
</td>
<td style="width: 450px; padding-left:5px">
Media disponibilità #half available
</td>
<td style="background-color:#058d08; width:80px">
</td>
<td style="width: 383px; padding-left:5px">
Posti disponibili #available
</td>
<td style="background-color:#000000; width:80px">
</td>
<td style="width: 383px; padding-left:5px">
Non disponibile # none available
</td>
</tr>
</table>
</div>
<div id="calendar">
<span id="ctl00_ContentPlaceHolder1_acc_Calendario1_myCalendario1"
class="calendario">
<table class="calendario" summary="Summary" cellspacing="0">
<caption>Calendario eventi</caption>
<tr class="calTitolo">
<th>
<input type="submit"
name="ctl00$ContentPlaceHolder1$acc_Calendario1$myCalendario1$ctl01"
value="<" title="Clicca qui per andare al mese precedente"
class="pulsanteCalendario" />
</th>
<th colspan="5">
<span>agosto, 2017</span>
</th>
<th>
<input type="submit"
name="ctl00$ContentPlaceHolder1$acc_Calendario1$myCalendario1$ctl03"
value=">" title="Clicca qui per andare al mese successivo"
class="pulsanteCalendario" />
</th>
</tr>
<tr>
<th class="calDayHeader" scope="col">lun</th>
<th class="calDayHeader"
scope="col">mar</th>
<th class="calDayHeader" scope="col">mer</th>
<th class="calDayHeader" scope="col">gio</th>
<th class="calDayHeader" scope="col">ven</th>
<th class="calDayHeader" scope="col">sab</th>
<th class="calDayHeader" scope="col">dom</th>
</tr>
<tr>
<td title="Giorno non disponibile" class="otherMonthDay">31</td>
<td title="Tutto occupato" class="calendarCellRed">1</td>
<td title="Giorno non disponibile" class="noSelectableDay">2</td>
<td title="Tutto occupato" class="calendarCellRed">3</td>
<td title="Tutto occupato" class="calendarCellRed">4</td>
<td title="Giorno non disponibile" class="noSelectableDay">5</td>
<td title="Giorno non disponibile" class="noSelectableDay">6</td>
</tr>
<tr>
<td title="Tutto occupato" class="calendarCellRed">7</td>
<td class="calendarCellOpen">
<input type="submit"
name="ctl00$ContentPlaceHolder1$acc_Calendario1$myCalendario1$ctl12"
value="8" title="8 agosto 2017, Posti disponibili"
class="pulsanteCalendario" />
</td>
<td class="calendarCellOpen">
<input type="submit"
name="ctl00$ContentPlaceHolder1$acc_Calendario1$myCalendario1$ctl12"
value="8" title="8 agosto 2017, Posti disponibili"
class="pulsanteCalendario" />
</td>
<td class="calendarCellOpen">
<input type="submit"
name="ctl00$ContentPlaceHolder1$acc_Calendario1$myCalendario1$ctl12"
value="8" title="8 agosto 2017, Posti disponibili"
class="pulsanteCalendario" />
</td>
<td class="calendarCellOpen">
<input type="submit"
name="ctl00$ContentPlaceHolder1$acc_Calendario1$myCalendario1$ctl12"
value="8" title="8 agosto 2017, Posti disponibili"
class="pulsanteCalendario" />
</td>
<td title="Giorno non disponibile" class="noSelectableDay">9</td>
<td title="Giorno non disponibile" class="noSelectableDay">10</td>
</tr><tr>
<td title="Giorno non disponibile" class="noSelectableDay">14</td>
<td title="Giorno non disponibile" class="noSelectableDay">15</td>
<td title="Giorno non disponibile" class="noSelectableDay">16</td>
<td title="Giorno non disponibile" class="noSelectableDay">17</td>
<td title="Giorno non disponibile" class="noSelectableDay">18</td>
<td title="Giorno non disponibile" class="noSelectableDay">19</td>
<td title="Giorno non disponibile" class="noSelectableDay">20</td>
</tr><tr>
<td title="Giorno non disponibile" class="noSelectableDay">21</td>
<td title="Giorno non disponibile" class="noSelectableDay">22</td>
<td title="Giorno non disponibile" class="noSelectableDay">23</td>
<td title="Giorno non disponibile" class="noSelectableDay">24</td>
<td title="Giorno non disponibile" class="noSelectableDay">25</td>
<td title="Giorno non disponibile" class="noSelectableDay">26</td>
<td title="Giorno non disponibile" class="noSelectableDay">27</td>
</tr><tr>
<td title="Giorno non disponibile" class="noSelectableDay">28</td>
<td title="Giorno non disponibile" class="noSelectableDay">29</td>
<td title="Giorno non disponibile" class="noSelectableDay">30</td>
<td title="Giorno non disponibile" class="noSelectableDay">31</td>
<td title="Giorno non disponibile" class="otherMonthDay">1</td>
<td title="Giorno non disponibile" class="otherMonthDay">2</td>
<td title="Giorno non disponibile" class="otherMonthDay">3</td>
</tr></table></span>
</div>
<div id="orari" >
<input type="hidden"
name="ctl00$ContentPlaceHolder1$acc_Calendario1$HiddenField1"
id="ctl00_ContentPlaceHolder1_acc_Calendario1_HiddenField1" />
</div>
</div>
最佳答案
这就是我要做的,但我不太确定这是否有效:
while True:
for dates in elementos:
if dates.is_enabled():
dates.click()
driver.find_element_by_id("ctl00_ContentPlaceHolder1_acc_Calendario1_repFasce_ctl01_btnConferma").click()
#if elementos > 0:
#driver.find_element_by_class_name("calendarCellOpen").click()
#else:
driver.find_element_by_xpath("//input[@value='<']").click()
driver.find_element_by_xpath("//input[@value='>']").click()
关于python - 我有一个日历选择器。如何使用 Selenium 和 Python 选择可用日期?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43422464/
Selenium IDE、Selenium RC 和 Selenium WebDriver 有什么区别;我们可以在什么样的项目中使用它们?任何建议将不胜感激。 最佳答案 Selenium IDE 是一
我的 Selenium 服务器在远程服务器上运行。我从我的本地 PC 启动我的 Selenium 脚本,它从网站获取数据。 例如,我的 Selenium 脚本执行这段 JS 代码: JSON.stri
Selenium 中“//div[.//a[text()='SELENIUM']]”和“//div[//a[text()='SELENIUM']]”有什么区别xpath。 有人可以澄清我在 xpath
我正在创建自动冒烟测试。我读到在单元测试中使用多个断言不是一个好的做法,这条规则是否也适用于使用 selenium 的 webdriver 测试? 在我的冒烟测试中,有时我会使用 20 多个断言来验证
我在一个变量中存储了一个值,在另一个变量中存储了第二个值,现在我想将这两个数字相加。我无法做到这一点,我尝试过下面的代码,但它不起作用 store 6 w sto
Selenium 中的回车键和回车键有什么区别? This related SO answer并且提供的链接说明它们是不同的。我还注意到,在使用 Firefox 24.2 时,回车键将发送一个 HTM
以下是我遇到异常的详细信息: 当我使用以下命令启动节点时,出现如下错误: F:\SeleniumGrid\Jars>java -jar selenium-server-standalone-3.0.0
我是 的新手 Selenium 我对版本号有点困惑。 Selenium 2.0 2011年发布。我刚刚下载了 Selenium IDE Firefox 扩展,版本为 1.7.2 .是否还有 IDE 的
我正在使用 Selenium 运行Codeception 2。我可以看到 Selenium 打开了浏览器并运行了测试。然后,我从代码接收中得到一个错误,即存在失败的断言。 我知道有一个HTML文件可以
Closed. This question needs to be more focused。它当前不接受答案。 想要改善这个问题吗?更新问题,使它仅关注editing this post的一个问题。
我想关闭弹出窗口(已知的窗口名称),然后返回到原始窗口。 我该怎么办? 如果我无法获得窗口中关闭按钮的常量。那么有没有达到目标的一般行为? 最佳答案 你有没有尝试过: selenium.Close()
我正在用webdriver做一个测试机器人。我有一个场景,它单击一个按钮,打开一个新窗口,并且它通过特定的xpath搜索元素,但是有时没有这样的元素,因为可以将其禁用,并且出现此错误:org.open
我是第一次使用Selenium,对这些选项不知所措。我在Firefox中使用IDE。 当我的页面加载时,它随后通过JSONP请求获取值,并在其中填充选择中的选项。 我如何让Selenium等待选择中的
我开始使用nightwatch.js编写e2e测试,我注意到我想在目标浏览器的控制台(开发人员工具)中手动检查一些错误。但总是在我打开开发者控制台时,浏览器会自动关闭它。这是selenium还是nig
我正在尝试使用以下方式刮除Glassdoor的评论: https://github.com/MatthewChatham/glassdoor-review-scraper 但是我得到了错误并且不知道如
背景 我设置了一个Selenium Grid项目,以在两种不同的浏览器Chrome和Firefox中执行测试。我正在使用Gradle执行测试。该测试将成功执行两次,一次按预期在Chrome中执行,一次
当测试失败时,运行 selenium 测试的浏览器将关闭。这在尝试调试时没有帮助。我知道我可以在失败时选择屏幕截图,但如果没有整个上下文,这并没有帮助。在浏览器仍然可用的情况下,我可以回击并检查发生了
使用 Selenium Web 驱动程序而不是 Selenium RC 启动新的测试框架是个好主意吗?对于 Selenium Web 驱动程序,并非所有 Selenium 方法都已实现。那么使用 Se
我使用 selenium 页面对象模型来定义所有页面元素。我对元素命名所遵循的命名约定不太相信,并且感觉太长了。请对此提出建议。 @FindBy(xpath = "//tbody[@id='tabvi
有一个带有按钮的 html 页面,我的 Selenium 测试正在测试,当单击按钮时,会执行一个操作。 问题是,看起来点击发生在 javascript 执行之前 - 在处理程序绑定(bind)到页面之
我是一名优秀的程序员,十分优秀!