java - How to easily get vaadin testbench queries? -


i've seen vaadin testbench adds extension of by class available in selenium allows by.vaadin() in theory more awesome selenium counterparts.

the problem i'm having is...how (or more tester) construct query readable by.vaadin()? selenium use selenium ide can point @ element, how do same vaadin?

i've started application in debug mode console seems generate java code:

buttonelement button1 = $(tabsheetelement.class).id("maintabsheet")     .$(horizontallayoutelement.class)     .$$(horizontallayoutelement.class).$$(buttonelement.class).first(); 

according documentation (http://vaadin.com/download/book-of-vaadin/current-br/html/testbench.selectors.html) need selector in form of:

 "bookexamplestobetested::/vverticallayout[0]/childcomponentcontainer[1]/vlabel[0]" 

so how construct such query? preferably in point-and-click kind of way?

as explained here

a vaadin selector begins ui identifier. url path of ui, without slashes or other special characters. example, /book-examples/tobetested bookexamplestobetested. after identifier, comes 2 colons "::", followed slash-delimited component path component selected. elements in component path client-side classes of vaadin user interfacer components. example, server-side verticallayout component has vverticallayout client-side counterpart. path elements except leaves component containers, layouts. exact contained component identified index in brackets. bookexamplestobetested::/vverticallayout[0]/childcomponentcontainer[1]/vlabel[0]

however reconsider using such detailed selector in web tests have many disadvantages. tests have hard dependency on name of ui, structure of layouts , component hierarchy. more flexible approach identify items in way has no knowledge position of component in layout hierarchy , refers components html element id, unique css class, or maybe location attribute customlayout. way web tests simpler , change resistant. when change layouts, reorder components or add more, tests not break. can use regular webdriver selectors by.byid, by.byclassname , such.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -