1

我们选择自动化脚本的上传文件。它显示了这样的假路径。(C:\fakepath\Clients.pdf) 但我再次运行脚本它不起作用。

    open    https://testeastaccount.pascalapp.com/app/dashboard 
click   //li[@id='Documents']/a/div/i   
click   xpath=(//button[@type='button'])[3] 
click   link=Add Document   
click   name=contact_rec    
type    name=contact_rec    c
click   //div[@id='Upload-document']/form/div[2]/div/div/div/div/div/ul/li[10]/a    
click   link=Grant Linked Accounts Access   
click   link=Grant Linked Accounts Access   
click   //div[@id='Upload-document']/form/div[2]/div/div/div/div/div[3]/button  
selectFrame index=11    
click   //html[@id='ng-app']/body/div/div[2]/div[2]/div/section/div/div/button  
type    //input[@type='file']   C:\personal\Clients.pdf
click   //html[@id='ng-app']/body/div/div[2]/div[2]/section[2]/div[2]/button[2] 
selectFrame relative=parent 
click   name=yeartags   
select  name=yeartags   label=Tax Year 2015
click   xpath=(//option[@value='2015'])[2]  
click   xpath=(//textarea[@name='description'])[4]  
type    xpath=(//textarea[@name='description'])[4]  dfd
click   //textarea[@name='contact'] 
type    //textarea[@name='contact'] ffdfdffd
click   //div[@id='Upload-document']/form/div[3]/button[2]  
click   link=exact:Document Firm Tags * 
click   //div[@id='tagsdiv']/ul/li[2]/div/label/span    
click   //div[@id='tagsdiv']/ul/li[3]/div/label/span    
click   link=exact:Document Firm Tags * 
click   //div[@id='Upload-document']/form/div[3]/button[2]  
click   //div[@id='Upload-document']/form/div[3]/button
4

1 回答 1

1

您应该Object spy再次使用记录元素。大多数情况下,这些错误的原因是记录了错误的 Web 元素。您可以尝试使用同一元素的另一个标识符。

于 2018-04-04T07:28:39.260 回答