使用webdriver firefox在CRM应用程序中输入数据

时间:2014-06-10 10:59:24

标签: javascript python selenium webdriver crm

我正在使用带有python的webdriver尝试自动化我们正在创建的新CRM网站。我是webdriver的新手,我无法将数据输入到应用程序的字段中。我可以毫无问题地阅读它们,但我似乎无法将数据输入其中。要在现场阅读数据,我只需要

   Mobile_Num= driver.find_element_by_id("mobilephone").text

工作正常。但是,当我尝试使用相同选择器的send_keys时,它不起作用。我累了

Mobile_Num.send_keys(Keys.RETURN)
Mobile_Num.send_keys(Keys.TAB)
Mobile_Num.click()
Mobile_Num.send_keys("11111")

<td id="mobilephone_c" class="ms-crm-ReadField-Normal ms-crm-FieldLabel-LeftAlign" title="Type the mobile phone number for the contact.">
<td id="mobilephone_d" class="ms-crm-Field-Data-Print" data-height="24">
<div id="mobilephone" class="ms-crm-ltrcontrol ms-crm-Inline-Chrome nvarchar" tabindex="1110" data-layout="0" data-fdeid="PrimaryEntity" data-formid="1fed44d1-ae68-4a41-bd2b-f13acac4acfa" data-attributename="mobilephone" data-initialized="true" aria-describedby="mobilephone_c" title="This is the Value of field" haserror="false">
<div class="ms-crm-Inline-Value" style="display: block;">
<span>
<a class="ms-crm-gridurl ms-crm-Phone" href="#" title="Prefix the number with "+<country code><area code>" and install Skype to make calls from Microsoft Dynamics CRM.">This is the Value of field</a>
<div class="ms-crm-Inline-GradientMask"></div>
</span>
</div>
<span class="ms-crm-Inline-LockIcon" style="display: none;">
<div class="ms-crm-Inline-Edit" style="display: none;">
<span class="ms-crm-Inline-WarningIcon" title="" style="display: none;">
</div>
</td>

Webdriver在测试后未显示任何错误,但如果检查了数据,则无法正确更新。我正在使用firefox驱动程序。 我已经搜索了这个问题,但收效甚微。任何人都可以指出我在正确的方向,即我需要javascript来触发事件,然后使用webdriver输入文本?我认为webdriver应该可以做到这一切!感谢

0 个答案:

没有答案