Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
User interface 在MSCRM 2013的查找字段上执行Selenium自动化_User Interface_Selenium Webdriver_Automation_Dynamics Crm - Fatal编程技术网

User interface 在MSCRM 2013的查找字段上执行Selenium自动化

User interface 在MSCRM 2013的查找字段上执行Selenium自动化,user-interface,selenium-webdriver,automation,dynamics-crm,User Interface,Selenium Webdriver,Automation,Dynamics Crm,我无法在MSCRM的查找字段上执行selenium脚本 我试图从MSCRM 2011中的查找列表中选择一个项目,它与下拉列表不同。如果单击查找字段上的查找图像,则会打开一个新窗口。在新窗口中,将显示一个记录列表,用户必须通过单击相应的复选框选择特定记录,然后单击“确定”按钮。最后,所选记录将显示在查找字段中 查找字段的DOM结构 <td class="Lookup_RenderButton_td" style="width: 21px"> <img id="customerid

我无法在MSCRM的查找字段上执行selenium脚本

我试图从MSCRM 2011中的查找列表中选择一个项目,它与下拉列表不同。如果单击查找字段上的查找图像,则会打开一个新窗口。在新窗口中,将显示一个记录列表,用户必须通过单击相应的复选框选择特定记录,然后单击“确定”按钮。最后,所选记录将显示在查找字段中

查找字段的DOM结构

<td class="Lookup_RenderButton_td" style="width: 21px">
<img id="customerid" class="ms-crm-ImageStrip-btn_off_lookup ms-crm-Lookup" defaultviewid="{A9AF0AB8-861D-4CFA-92A5-C6281FED7FAB}" savedquerytype="" isdisplayonly="false" resolveemailaddress="0" showproperty="1" disableviewpicker="0" disablequickfind="0" disablemru="0" allowfilteroff="1" autoresolve="1" defaulttype="1" lookupstyle="single" lookupbrowse="0" lookuptypeicons="/_imgs/ico_16_1.gif?ver=1287191314:/_imgs/ico_16_2.gif?ver=1287191314" lookuptypenames="account:1:Account,contact:2:Contact" crmattributeid="{09d25a7a-420f-42f7-bad4-192edc51356a}" lookuptypes="1,2" attrpriv="7" attrname="customerid" style="ime-mode:auto" req="2" alt="Click to select a value for Customer Name." src="/_imgs/btn_off_lookup.png" title="Click to select a value for Customer Name." forcesubmit="false">
<a tabindex="-1" onclick="Mscrm.Utilities.click(previousSibling);" href="#" title="Click to select a value for Customer Name."></a>
</td>
下一行用于选择复选框

driver.findElement(By.xpath("//table/tbody/tr[2]/td[1]/input")).click();
对于查找工作,您可以查看下面的链接


让我们试着了解一下要自动化查找必须做什么,您可以做的第一件事是单击打开查找并选择第一个。但是如果你有一个很长的列表,很难滚动和选择。我建议输入查找文本并移动到其他字段,CRM将为您解决查找问题

对于查找,Xpath类似于//div[@id='new\u lookupid']/div[1],inputbox为//input[@id='new\u lookupid\u ledit'],您需要在查找中执行单击并按住,然后释放并单击操作,以在键入输入框之前获得带有插入符号的输入框,如下所示:

Actions action = new Actions(driver);

action.MoveToElement(driver.FindElement(By.XPath("//div[@id='new_lookupid']/div[1]"))).
ClickAndHold().Release().Click().Perform();

IWebElement typeIntoLookup= driver.FindElement(By.XPath("//input[@id='new_lookupid_ledit']"));

   //send keys        
       typeIntoLookup.SendKeys("ElementofLookup"); //the lookup text

我知道你是用java做的,上面的例子是用C做的,所以请期待语法上的差异,但在VS2015中它对我有用,希望它对你有用。

让我们试着了解一下,要实现自动查找,首先要做的是单击打开查找并选择第一个。但是如果你有一个很长的列表,很难滚动和选择。我建议输入查找文本并移动到其他字段,CRM将为您解决查找问题

对于查找,Xpath类似于//div[@id='new\u lookupid']/div[1],inputbox为//input[@id='new\u lookupid\u ledit'],您需要在查找中执行单击并按住,然后释放并单击操作,以在键入输入框之前获得带有插入符号的输入框,如下所示:

Actions action = new Actions(driver);

action.MoveToElement(driver.FindElement(By.XPath("//div[@id='new_lookupid']/div[1]"))).
ClickAndHold().Release().Click().Perform();

IWebElement typeIntoLookup= driver.FindElement(By.XPath("//input[@id='new_lookupid_ledit']"));

   //send keys        
       typeIntoLookup.SendKeys("ElementofLookup"); //the lookup text

我知道你是用java做的,上面的例子是用C做的,所以请期待语法上的差异,但在VS2015中它对我有用,希望它对你有用。

请发布你迄今为止所做的工作的代码,并告诉我们你试图实现的。@JamieRees:Hi。。。我更新了问题。你能检查一下上面的问题吗?@RahilKumar你是如何自动查找的?请发布你到目前为止所做的工作的代码,并告诉我们你正在努力实现的目标。@JamieRees:Hi。。。我更新了问题。你能检查一下上面的问题吗?@RahilKumar你是如何自动查找的?
Actions action = new Actions(driver);

action.MoveToElement(driver.FindElement(By.XPath("//div[@id='new_lookupid']/div[1]"))).
ClickAndHold().Release().Click().Perform();

IWebElement typeIntoLookup= driver.FindElement(By.XPath("//input[@id='new_lookupid_ledit']"));

   //send keys        
       typeIntoLookup.SendKeys("ElementofLookup"); //the lookup text