rockmelonqa / rockmelonqa-ide

Test Automation IDE that generates and runs Playwright and Selenium code
MIT License
4 stars 3 forks source link

Issue with "Find By Relative" usage and that it causes codegen to fail #60

Closed brogreenmoon closed 1 year ago

brogreenmoon commented 1 year ago

I'm not sure what the usage of the "Relative" type is when locating page elements. We need to discuss it.

It currently causes codegen to fail as well:

image

image

brogreenmoon commented 1 year ago

I tried this usage:

image

but it gave:

image

vothaison commented 1 year ago

Hi @brogreenmoon

The usage of findBy 'Relative' is like this:

image

Basically we are locate the nested element

The use case could be like this

image

in which case the Child element is resolved to the element on line 11, not the one on line 13.

It is just what we have in the test-tool project (https://dev.azure.com/zapcentral/test-tool/_git/test-tool), which may or may not be relevant in our the IDE project.

brogreenmoon commented 1 year ago

Hi @vothaison,

Your example uses CSS - should it also work for usages like the following? i.e. it doesn't - codegen fails given this usage

image

vothaison commented 1 year ago

Hi @vothaison CC @veebs I think I will assume that if the parent element is located by Xpath, then the child element will also by located by Xpath => Child element has the same Locator to the parent element. That is gonna be a big change. Currently we only support Css selector for the elements that have Locator = Relative.

quockhanh commented 1 year ago

cc @brogreenmoon

veebs commented 1 year ago

Can we split the Relative action into 2:

Please make sure we put in some validation for the expected format of the data column. Also, perhaps put in the above example a placeholder in the data field

brogreenmoon commented 1 year ago

Confirmed usage of Relative XPath:

image

image

image

image

brogreenmoon commented 1 year ago

Confirmed usage of Relative CSS:

image

image

image

image