Readable code to deal with "buttons" based on css, divs and spans
November 12, 2020 at 7:07pmThe Gauge community has a new home. This thread is preserved for historical purposes. The content of this conversation may be innaccurrate or out of date. Go to new community home →
Readable code to deal with "buttons" based on css, divs and spans
November 12, 2020 at 7:07pmHi all,
Original question is at https://github.com/getgauge/taiko/issues/1676
Using "click($(".options-button"))", Taiko is able to click into the gear icon but I'm looking for a more readable way to implement it, not depending on css/xpath selectors
As suggested, I used "click(listItem(toRightOf("Web Canvas")))" and unfortunately is not working for this case
I'd appreciate any suggestions at this point. Thanks!
November 13, 2020 at 7:59am
Are you also in control of the frontend code? If you are, adding a test-element name could be an easy way to get a unique selector for the button.
e.g.
click($('[test-element="settingsButton"]'));
THanks (skarra) . Unfotunately, I'm not in control of the source code
Does click(button(toRightOf(textBox("Web Canvas")))); work? My go-to in these solutions is to just try all kinds of different proximity selectors, but it's hard without the actual page available.
Hope you find a working solution!
(skarra) again, thanks for your help! The above coded is not able to detect the icon neither; I tried replacing button() by link(), listItem(), checkBox()... with no success
I'll try the remaining ones but if you think uploading the HTML code of the page would help, I can do it :)
November 15, 2020 at 9:44pm
November 16, 2020 at 1:59pm