This thread pretty much proves the OR needs a rethink:
The OP, @8316-KARINE1506 has stated “we are not programmers”, which is precisely what the OR and Recorder are meant to be for: aid non-programmers in recording and targeting HTML elements for automated testing.
TWO pages of confusion and still no resolution. Admittedly, there is a slight language barrier, but no actual programmer (or anyone “comfortable” in code) would find themselves in that predicament, struggling to describe what they want to do, where and with what – precisely what the Recorder and OR are meant to solve.
I would really like to say to Karine, STOP using the OR, build a single reference to the object (or objects) in question, and code the steps directly using “super tool that does not exist”. That tool is the rewritten Recorder/OR tool that does not create a minefield or jungle full of wasted and pointless artifacts with their cumbersome and unnecessary multiple access methods each time you open the Recorder to “start again”.
I’m sure Karine’s problem will be solved eventually, but the lengths to which “we” need to go to furnish the “best answer” should be aided by Katalon Studio and its tools not hindered by it.
I want Recorder/Spy to be a bit more intelligent. What kind of intelligence do I want?
Recorder/Spy automatically generates multiple factors for selection methods: tag, class, text, css, xpath, etc. They generates factors but does not provide information how much each factors effective agaist the target HTML.
Imagine, Recorder/Spy is able to try applying factors against the target HTML and shows the number of selected in the target HTML by each factors. See the following example:
number of selected elements = 0 means NO GOOD, useless factor
number of selected elements = 1 means GOOD.
number of selected elements = 2 or more means Not too bad but requires refinement
I want a button to invoke “trying to apply the factors against the target HTML”. I would like something similar to $x function in the Chrome DevTool Command Line API: Chrome DevTools - Chrome Developers
(Well, I should confess I do not expect the xpath expression generated by Recorder/Spy to be useful. Always I delete the auto generated expression, write my expression manually and test it using Browsers $x. That’s the way I do.)
In the above example I would choose the factor |text |equals|Katalon Studio| because it select 1 single element, which is good enough.
Recorder/Spy should recommend the best effective selection factor (which has count=1).
I think the colomn titled “Detect Object by” is a riddle for a newbie. A newbie user would expect Recorder/Spy to recommend the best mix of selection factors automagically. Therefore he/she would wonder “Why do you ask me which to use?”
Another thing I would complain about is that the Recorder/Spy generates xpaths too much verbose. For example in the above screenshot you see:
//*[text()='Katalon Studio'][count(.|id('page-top')/div[@class="intro-headerhomepage"]/div[@class=" ...........
What the hell is it? I would never spare my time to understand what it means. It would be a correct XPath expression; but too verbose to understand. So verbose the generated xpath is that every body will quickly give it up. This terrible verbosity discourages newbies to study more about the XPath and CSS Selector technology. They will say “Oh, such complicated stuff is no my business”
Well, I hope somebody develop a super intelligent XPath generator which generates the best effective XPath expression which could only be written by a human expert with years of XPath experiences. It would be a kind of AI. ---- Actually I have never seen this type of software. I do not think this excellency can be achieved in near future.
I think it would be more productive if Katalon instructs newbies how to use Browsers’ DevTool ‘inspect’ function ( https://developers.google.com/web/tools/chrome-devtools/inspect-styles/edit-dom ), than proposing a unconsievablly-verbose XPath expression.
It is really interesting discussion and ideas.
As my understanding of this post ,does this mean if we want a powerful OR/ web spy, we should create it by our own?
does this mean if we want a powerful OR/ web spy, we should create it by our own?
I always use Web Objects stored in the Object Repository in Katalon Studio. I usually create Web Objects using the Recorder tool, sometimes using the Spy tool. But I always rewrite the generated XPath expressions as I like it manually with help of Google Chrome’s Developer Tools. And I often rename the Web Objects to make them simpler. I would never leave the generated Web Objects as generated. I always refactor them. This means that, simply, I am more experienced with XPath technology than these tools. Please note, my story would not apply to those who are not enough experienced with the technology.