Issue
In JAVA Selenium - I am not able to click the dropdown and select a value from it, this is not a select dropdown. This is a saleforce site. I have seen it working 1 in 10 executions but not getting it work consistently.
enter image description here
This is the HTML for the dropdown and it is not getting clicked, the xpath for the dropdown used is
//*[@data-name='billingRoadType']//*[name()='lightning-base-combobox']//button
enter image description here
This is the HTML for the dropdown values. the xpath for the dropdown value used is
//*[@data-name='billingRoadType']//*[@data-value='Otro']
Have tried JavaScript executor, Action class and click sometimes the JSExecutor works but that is like 1 in 10 times.The application is in salesforce. Have tried explicit waits also but not working
Getting NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//[@data-name='billingRoadType']//[@data-value='Otro']"}
Solution
Hi @qatesterbecomingprogrammer and @Pradheep Raaj
This issue was resolved by the following from the root tag(webruntime-app) i had to write the xpath or css, we could find it from document.querySelector was sometimes working and other times it was not working in the browser.
Therefore tried writing the xpath from the root to make it work. Thanks for your suggestions and inputs.
WebElement app = driver.findElement(By.cssSelector("webruntime-app"));
Thread.sleep(1000);
app.findElement(By.cssSelector(".slds-combobox__form-element.slds-input-has-
icon.slds-input-has-icon_right button"));
Thread.sleep(3000);
app.findElement(By.cssSelector("[part='combobox'] [title='Horeca
diurno']")).click();
Answered By - Venkatram Ayyer
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.