我需要选中一个名为标准的复选框
请看截图。
我可以通过以下方式展开information type
下拉菜单:
By.xpath("//div[contains(@class, 'expand') and h3[contains(text(), 'Information Type')]]")
答案 0 :(得分:1)
展开using ppdai.user.vip.model;
using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Data.Entity.ModelConfiguration.Configuration;
namespace ppdai.user.vip.model.mapping
{
public class GoodsMapping: EntityTypeConfiguration<Goods>
{
public GoodsMapping()
{
this.Property(x => x.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
this.HasKey(x => x.Id);
this.Property(x => x.GoodsQuantity).IsRequired();
this.Property(x => x.GoodPrice).IsRequired();
this.Property(x => x.GoodScore).IsRequired();
this.Property(x => x.GoodTypeId).IsRequired();
this.HasRequired(x => x.GoodType)
.WithMany(x => x.Goods)
.HasForeignKey(x => x.GoodTypeId);
}
}
}
元素后,您应该等到Information Type
复选框元素变为可见并可使用Standards
点击,如下所示: -
WebDriverWait
您也可以使用此new WebDriverWait(driver,10).until(ExpectedConditions.elementToBeClickable(By.xpath(".//li[normalize-space(.)='Standards']/input"))).click();
:
xpath