Open EthanKing96 opened 5 years ago
We've also seen this in a different part of the UI since the Spring 19 release, and are still looking for a good workaround. It appears to be a general issue with chromedriver when interacting with elements inside a shadow DOM: https://stackoverflow.com/questions/49906451/web-driver-click-on-element-within-shadowdom-is-returning-error-messageunk
Its almost like there needs to be a way to double click on everything without breaking the test. If you inspect on say the Account object the first time you get brought to the top of the body element, then on second inspect you get brought to the actual element. Could that be a possible fix in the meantime? I have to create automated salesforce tests for my position, so this breaking is making me scramble a bit.
Any sort of help would be hugely beneficial.
Thank you!
@davisagli I figured out a work-around. Use firefox with geckodriver. Everything works as intended now. Thank you!
While Firefox is currently a life saver for interacting with lightning components that have a shadow DOM, I would like to see an approach for us to also use Chrome without hassle.
I have tried to read up on the problem in the repositories involved and found that robot points to selenium and selenium points to WC3 and nothing much has happened in about a year.
Was wondering if CCI could implement a python class that would solve the problem at hand.
For the specific case of navigating to a tab, you can use the Select App Launcher Tab
keyword from the Salesforce library. (It uses the app launcher, which has the benefit of working even if that tab isn't shown in the current app.)
I'm not sure at this point what the right general solution is for interacting with shadow DOM elements -- we haven't spent much time on this, because it's not something that Salesforce.org product teams have been running into much, somewhat surprisingly.
That is indeed interesting. Any custom component utilizing lightning-input (or lightning:input for that matter) is not accessible anymore for us with robot/selenium/webdriver/chrome.
Nominally, that was part of the winter release - but the tests started failing long after the tests succeeded in the first winter20 orgs. I suppose they pushed that a little later.
My knowledge is not sufficient to implement what the Release Note suggest ( https://www.seleniumeasy.com/selenium-tutorials/accessing-shadow-dom-elements-with-webdriver )
If I can be pointed in the right direction, I will further investigate.
On Tue, 22 Oct 2019 at 16:12, David Glick notifications@github.com wrote:
For the specific case of navigating to a tab, you can use the Select App Launcher Tab keyword from the Salesforce library. (It uses the app launcher, which has the benefit of working even if that tab isn't shown in the current app.)
I'm not sure at this point what the right general solution is for interacting with shadow DOM elements -- we haven't spent much time on this, because it's not something that Salesforce.org product teams have been running into much, somewhat surprisingly.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SFDO-Tooling/CumulusCI/issues/987?email_source=notifications&email_token=AEAGS6S2WMUKMHLTV5GVOUDQP4C6PA5CNFSM4GXPN7B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB54PMI#issuecomment-544982961, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAGS6RGCER6CYBEYGNB5PDQP4C6PANCNFSM4GXPN7BQ .
We're still happy with firefox+robot - just curious if there's any change since last we talked?
@boakley Am I right in thinking we are doing a click using javascript instead of the selenium click command to work around shadow DOM navigation issues in some cases? If so could you point @Szandor72 to an example?
@Szandor72 Is this issue still impacting you?
Error: JavascriptException: Message: javascript error: Cannot read property 'defaultView' of undefined (Session info: chrome=72.0.3626.109) (Driver info: chromedriver=2.46.628411 (3324f4c8be9ff2f70a05a30ebc72ffb013e1a71e),platform=Mac OS X 10.14.0 x86_64)
The error is occurring after I login, and start Create New Contact process. Robot can't find the Contact tab and sends back this error.
I think the issue is that when robot is running in chrome and you inspect the inspect element brings you to the top of the body element. Then you have to inspect again and it will actually bring you to the element you selected. Is there a work around for that? This didn't happen before the Spring 19' update on regular tabbed objects, although it did happen on object buttons such as Accounts > New Button. To work around that I did Wait For Aura after opening an object page to select the New button. But that does not seem to work in this scenario.
For some reason I cant attach a robot file so I will paste the code below. Please help!