Selenium not able to identify the buttons on Salesforce app | Selenium Forum
M
Posted on 13/03/2016
Hello,

I am having trouble running my selenium scripts. I could identify the IDs of the buttons on the Salesforce application using Firebug and Firepath. After using the IDs in my script, I get an error "Unable to locate the element". I have tried Xpath and CSS also, but no luck. Below is the page source.Could you please look into it?

<input class="btn" type="button" onclick="if ((Modal.confirm && Modal.confirm('Once you submit this record for approval, you might not be able to edit it or recall it from the approval process depending on your settings. Continue?')) || (!Modal.confirm && window.confirm('Once you submit this record for approval, you might not be able to edit it or recall it from the approval process depending on your settings. Continue?'))) navigateToUrl('/p/process/Submit?retURL=%2Fa0pr00000004HNl&_CONFIRMATIONTOKEN=VmpFPSxNakF4Tmkwd015MHhORlF5TVRvME5Eb3hPUzQxTmpOYSx3RUp3R2dZdHg5cjVhaXphTGxhZHlGLE5qazROV1pt&id=a0pr00000004HNl','DETAIL','submit');" title="Submit for Approval" name="submit" value="Submit for Approval"/>

Thanks
Madhu

M
Replied on 13/03/2016

Hi Madhu,

Can you try to add Thread.sleep before your driver.findElement statement.


M
Replied on 13/03/2016

I did that, still no luck.


M
Replied on 13/03/2016

It works in Chrome browser but the same does not work in Firefox. Not sure, why?


M
Replied on 13/03/2016

what is the code you're using?


M
Replied on 14/03/2016

driver.findElement(By.xpath("//*[@title='Submit for Approval']")).click();


The webdriver is able to identify the element using the above xpath and clicks the button in Chrome. The same code fails in Firefox. I am using the latest version of webdriver and my firefox version is 44.0.2.


M
Replied on 14/03/2016

send a screen shot of error when running firefox.


M
Replied on 17/03/2016

Finally I am able to get it working in firefox. Once the script ran in Chrome successfully then it automatically ran in firefox without any issues. I do not know the exact reason for this behavior, but it worked.