Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dom not found, nowhere to look for dom #25

Closed
vanous opened this issue Jan 12, 2018 · 7 comments
Closed

Dom not found, nowhere to look for dom #25

vanous opened this issue Jan 12, 2018 · 7 comments

Comments

@vanous
Copy link

vanous commented Jan 12, 2018

Hi,

great extension! I am automating form filling in typo3 - it has quite complex page with navigation, uses dynamic fields id etc.

I select these fields with //*[contains(@data-formengine-input-name,"username")] which has been confirmed to work (about two weeks ago).

Now, when i reopen the saved TestCase, i get constant "Dom not found" or "Nowhere to look for dom" messages. So i try to edit my TestCase, edit click target, select field → it get's selected and id=formengine-input-5a587e3f267f1647856491 filled correctly into target, but immediate click on Find (without any reloading) results gain in "dom not found".

If i try it on some very simple webpage, it works.

Tested on:

Kantu extension: 2.2.1
Chrome: Version 63.0.3239.132 (Official Build) (64-bit)
Chromium: Version 63.0.3239.84 (Developer Build) built on Debian buster/sid, running on Debian buster/sid (64-bit)

Has this been a regression? Is there a way to see the inspected dom?

thank you

@vanous
Copy link
Author

vanous commented Jan 12, 2018

I have just confirmed, that the same xpath //*[contains(@data-formengine-input-name,"username")] works correctly in Selenium IDE.

It seems to me, that during search, Kantu is unable to access some parts of the DOM, but i am unfortunately unable to see what it sees and what now :(

thank you

@vanous
Copy link
Author

vanous commented Jan 12, 2018

If this helps to anyone, opening the form in a new tab helped. Probably some dynamic typo3 magic.

@vanous vanous closed this as completed Jan 12, 2018
@A9T9
Copy link
Owner

A9T9 commented Jan 12, 2018

Hi! ...so this sounds like you found a workaround? That is good :)

But a "Dom not found" or "Nowhere to look for dom" should never happen. Therefore, if you have a way for us to recreate it (e. g. a test macro) please let us know (reopen the ticket) and we will debug and fix it.

@vanous
Copy link
Author

vanous commented Jan 18, 2018

HI! Thank you for getting back. I can replicate it pretty much anytime. Problem is, that the page is behind login. After bit of digging around, i found where typo3 runs a demo site of this generation of CMS, where you can replicate it too. Info about the demo site: http://demo.typo3.org/ , admin/password are credentials as per their instructions.
Demo url: http://cms-next.demo.typo3.org/typo3

Now, what i do is that i am filling form when creating new users in Backend Users (menu → Backend users (1)) , selecting Create new record (2) on the screenshot below:

screenshot from 2018-01-18 15-23-03

And then filling fields of the form:

screenshot from 2018-01-18 15-23-16

To be able to select these fields with dynamic IDs, xpath is required, see my full Test case below.

(for whatever reason, for the values to really get to the form, i have to emulate "click" followed by "type" my text from csv and then even "send keys" KEY_TAB, but that is minor).

{
"CreationDate": "2018-1-18",
"Commands": [
{
"Command": "csvRead",
"Target": "b.csv",
"Value": ""
},
{
"Command": "click",
"Target": "//[contains(@data-formengine-input-name,"username")]",
"Value": ""
},
{
"Command": "type",
"Target": "//
[contains(@data-formengine-input-name,"username")]",
"Value": "${!COL4}"
},
{
"Command": "sendKeys",
"Target": "//[contains(@data-formengine-input-name,"username")]",
"Value": "${KEY_TAB}"
},
{
"Command": "click",
"Target": "//
[contains(@data-formengine-input-name,"password")]",
"Value": ""
},
{
"Command": "type",
"Target": "//[contains(@data-formengine-input-name,"password")]",
"Value": "${!COL1}"
},
{
"Command": "sendKeys",
"Target": "//
[contains(@data-formengine-input-name,"password")]",
"Value": "${KEY_TAB}"
},
{
"Command": "click",
"Target": "link=Personal Data",
"Value": ""
},
{
"Command": "click",
"Target": "//[contains(@data-formengine-input-name,"company")]",
"Value": ""
},
{
"Command": "type",
"Target": "//
[contains(@data-formengine-input-name,"company")]",
"Value": "${!COL5}"
},
{
"Command": "click",
"Target": "//[contains(@data-formengine-input-name,"first_name")]",
"Value": ""
},
{
"Command": "type",
"Target": "//
[contains(@data-formengine-input-name,"first_name")]",
"Value": "${!COL2}"
},
{
"Command": "click",
"Target": "//[contains(@data-formengine-input-name,"last_name")]",
"Value": "${!COL3}"
},
{
"Command": "type",
"Target": "//
[contains(@data-formengine-input-name,"last_name")]",
"Value": "${!COL3}"
},
{
"Command": "click",
"Target": "//[contains(@data-formengine-input-name,"email")]",
"Value": ""
},
{
"Command": "type",
"Target": "//
[contains(@data-formengine-input-name,"email")]",
"Value": "${!COL4}"
},
{
"Command": "click",
"Target": "css=button.btn.btn-sm.btn-default.dropdown-toggle",
"Value": ""
},
{
"Command": "clickAndWait",
"Target": "link= Save and create a new one",
"Value": "3"
}
]
}

Hope this helps,

cheers
Petr

@vanous vanous reopened this Jan 18, 2018
@vanous
Copy link
Author

vanous commented Jan 18, 2018

OK, some progress here. It seems to be virtual dom, probably in a iframe. I will get to the root of it :)

@vanous
Copy link
Author

vanous commented Jan 18, 2018

Solved, although I am not sure what the solution is, perhaps if the DOM contains iframes, show some info about it... perhaps this is out of scope of Kantu...

Here is what i did... Not sure what kantu equivalent is, this is how to get there in python selenuim, might be useful to someone:

driver.switch_to.default_content() #make sure to be on top of the main dom
driver.switch_to.frame(driver.find_elements_by_xpath('//iframe')[1]) #switch to iframe (second one in my case)
get elements now as usual

I haven't tried in Kantu yet.

@vanous vanous closed this as completed Jan 18, 2018
@JESii
Copy link

JESii commented Nov 1, 2018

FYI... I'm seeing this problem and have to reload the page to get things to work again. This is on an MUI/React component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants