我有一个包含数百个条目的列表。我认为该列表的总大小为 3.5 MB。
在调试问题时,我似乎无法查看任何超过 300 的条目,并且看到此消息“太大而无法显示内容。要显示的最大项目数:300'
有任何想法吗?
我有一个网站http://demoqa.com/registration/
我一直在尝试验证,当用户单击然后单击用户名或电话号码等必填字段时,是否会在未输入数据时出现“必填字段”错误。
有谁知道如何验证这一点?我刚在想
phone = self.driver.find_element_by_xpath("//div[contains(.,'Phone Number')]")
Run Code Online (Sandbox Code Playgroud)
然后使用类似 getError = phone.find_element_by_xpath() 并使用 (..) 尝试向上移动到父类,但没有运气!
我认为这很容易,但所有元素都具有相同的类名。我想我可以检查文本“此字段是必需的”,但我想保持整洁并编写一个方法,以便我可以在每个字段上使用它。
我今天花了很多时间寻找它并尝试不同的东西,所以任何帮助或想法都会很棒。
谢谢!
其他信息:
我可以告诉您单击该字段之前和之后会发生什么。我对解决此问题的最佳猜测是验证“电话号码”字段的类名,然后一旦单击关闭,验证类名是否已更改。如您所见,顶部是单击关闭之前,下方是出现所需字段文本的时间
<div class="fieldset">
<label class="" for="phone_9">Phone Number</label>
<input id="phone_9" class="input_fields piereg_validate[required,custom[phone_international]]" type="text" value="" placeholder="" name="phone_9">
</div>
<div class="fieldset error">
<label class="" for="phone_9">Phone Number</label>
<input id="phone_9" class="input_fields
piereg_validate[required,custom[phone_international]]" type="text" value=""
placeholder="" name="phone_9">
<div class="legend_txt">
<span class="legend error">* This field is required</span>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)