Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
6.9k views
by Contributing Tester (12 points)
edited by
I am trying to execute one automation script. Getting one error as 'javascript error: cannot read property defaultview of undefined '. I am not able to debugging it. I have tried to get help from google, but not getting any proper solution. The same script was working properly earlier

Could you please help me in this?

2 Answers

1 like 0 dislike
by
this is caused bcz of object not identified with the given object identification method. I also get the same issue when I try to automate the sales force. this is one of the tab (Accounts) that I need to click in slaesforce and I used in previously for identify the object below xpath . somehow it does not work and later I have updated the xpath. after that it worked fine.

<one-app-nav-bar-item-root one-appnavbar_appnavbar="" data-id="Account" data-assistive-id="operationId" aria-hidden="false" draggable="true" class="navItem slds-context-bar__item slds-shrink-none slds-is-active" role="listitem"><a href="/lightning/o/Account/home" title="Accounts" tabindex="0" draggable="false" aria-describedby="operationId-16" class="slds-context-bar__label-action dndItem"><span class="slds-truncate">Accounts</span></a>

previous Xpath : .//a[@title='Accounts']/span

updated Xpath: By.xpath(".//one-app-nav-bar-item-root[@class='navItem slds-context-bar__item slds-shrink-none'][a[span[text()='Accounts']]]")
0 like 0 dislike
by Contributing Tester (99 points)

It looks like somewhere in your script, you are identifying an element which is null and and you are trying to get defaultview  of it.

Can you post exact error stacktrace?


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...