Model 23 Part 15, Potential Lead Test:
Now Zoho.com add potential wiesses Company th vreate Lead. I am not able to accesses company Name and Last Name field. I can inspect element but getting error. I try to find frames, and try to locate inside frame too .
How van I acesses Company and Last Name field
Can you tell me how get xpath?
I used following xpath:
LeadNewCompany_id =Crm_Leads_COMPANY
LeadNewLastName_xpath = //div[@id='Leads_fldRow_LASTNAME']/div/input[@id='Crm_Leads_LASTNAME']
#LeadNewLastName_xpath = //input[@id='Crm_Leads_LASTNAME']
#//*@id="show"]/form/div[@id='rwb']/div[6]/div[@id='secDiv_Lead_Information']/div/div[2]/div[1]/div[2]/input[@id='Crm_Leads_COMPANY']
| Clicked sucessfully to //*[@id='crmpluscommonuiaddoptionicon']/i[@title='Quick Actions'] | ||
| 16:10:19 | Clicking to //*[@id="crmpluscommonuiaddrecordoptionlist_crm_Leads"] | |
| 16:10:19 | Clicked sucessfully to //*[@id="crmpluscommonuiaddrecordoptionlist_crm_Leads"] | |
| 16:10:40 | Typing in to LeadNewCompany_idand Data is ICI Panits | |
| 16:11:00 | no such element: Unable to locate element: {"method":"id","selector":"Crm_Leads_COMPANY"} (Session info: chrome=74.0.3729.169) (Driver info: chromedriver=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90),platform=Windows NT 10.0.17763 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'DESKTOP-ICHKOTQ', ip: '192.168.1.5', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_211' Driver info: org.openqa.selenium.chrome.ChromeDriver Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.44.609538 (b655c5a60b0b54..., userDataDir: C:\Users\Owner\AppData\Loca...}, cssSelectorsEnabled: true, databaseEnabled: false, goog:chromeOptions: {debuggerAddress: localhost:51738}, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: ignore, unhandledPromptBehavior: ignore, version: 74.0.3729.169, webStorageEnabled: true} Session ID: 297ce29804c327ddcc8daf94ec1541f7 *** Element info: {Using=id, value=Crm_Leads_COMPANY} |
Instructor
Ashish Thakur Replied on 24/06/2019
Please refer module 13 for a clearer understanding of XPaths. We have covered all the different ways of generating XPaths. In addition to that you can also learn different methods to locate an element on the page.
I used mutiple xpath, I have no issue to create and verify xpath in chrome, but when running script get an error. I checked frames, and there is no frame
Zoho has limit of 10 login each day , and I stuck here about a week. could you please let me know what is wrong in these xpath
driver.findElement(By.xpath("//input[@id='Crm_Leads_COMPANY']")).click();
//div[@id='Leads_fldRow_COMPANY']/div[2]/input[@id='Crm_Leads_COMPANY']
//div[@id='show']/form/div[@id='rwb']/div[@id='preHTMLContainer_Leads']/div[1]/div[@id='secContent_Lead_Information']/div[2]/div[@id='Leads_fldRow_COMPANY']/div[2]/input[@id='Crm_Leads_COMPANY']
Xpath:
driver.findElement(By.xpath("//input[@id='Crm_Leads_COMPANY']")).click();
driver.findElement(By.xpath("//input[@id='Crm_Leads_COMPANY']")).sendKeys(company);
Error:
Lead New Link Pass
Number of frames in a page :0
FAILED: CreateLeadTest({Runmode=Y, username=k.khan@nyesolutions.com, LeadconvCloseDate=10/20/2019, pwd=catch@22, LeadLastName=Potro, LeadconvAmount=600.0, LeadconvRoleSearch=Qualification, LeadCompanyName=ICI Panits, Browser=Chrome})
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@id='Crm_Leads_COMPANY']"}
//div[@id='Leads_fldRow_COMPANY']/div[2]/input[@id='Crm_Leads_COMPANY']
==============Naavigating websiteAppurl
==============Naavigating website URL IS Appurl
==============Naavigating website URL IS Appurl
Actual test is
Expected Test is Access your apps
Accesses APP NOT present ======Access your apps
CRM APP Link Pass
CRM LEFT Link Pass
Lead Link Pass
Lead Link CLICK :
FAILED: CreateLeadTest({Runmode=Y, username=k.khan@nyesolutions.com, LeadconvCloseDate=10/20/2019, pwd=catch@22, LeadLastName=Potro, LeadconvAmount=600.0, LeadconvRoleSearch=Qualification, LeadCompanyName=ICI Panits, Browser=Chrome})
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//div[@id='Leads_fldRow_COMPANY']/div[2]/input[@id='Crm_Leads_COMPANY']"}
(Session info: chrome=75.0.3770.100)
Instructor
Ashish Thakur Replied on 25/06/2019
As i can see the below exception
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//div[@id='Leads_fldRow_COMPANY']/div[2]/input[@id='Crm_Leads_COMPANY']"}
You are using the wrong XPath.
In addition to this, you are mentioning driver.findElement(By.xpath("//input[@id='Crm_Leads_COMPANY']")).click();
You need not to click on the text boz before entering text inside it.
I check the xpath in Chrome, and it highlighted text field in Yellow. all 3 xpath are checked in chrome and highlighted in yellow. can you let me know what is right xpath? I also look the frame but it is not helping
I resolved issue, you can close it
Thanks