As a developer I didn't expect UI tests to be so unpredictable. It's so frustrating when you see the button & it's clickable, but your "automated" test refuses to accept it
At least with Selenium, a stupid workaround was to identify the button, then pass it's (internal) Object to javascript's executor and run the .click() directly in browser rather than Selenium-side. Which technically doesn't match user behavior but hey, sometimes you need to test what's beyond that click...
I remember we had like 20 checks in our Selenium Button.click(). We checked visibility, clickable, not disabled, centered it on the screen (to avoid floating UI), checked if it was in a loading state, and then... finally... Clicked.
It has always been like this and always will. These tests are expensive and you must treat those like that. You're testing "everything". You write just the ones that are really important. Everything else RTL tests or similar.
If, when stuff like this happens, you spend some time talking to your cat about why you think it should be working instead of making a meme, you'll actually figure out what's wrong.
OP came back to reddit, and OP likes making memes :) . Some were removed because 2/ day post limit and some yes, I thought they were in bad taste. OP isn't a bot :)
Or...and hear me out - Let the dude make a meme about something he found funny. Are you sure you're on the right sub? My goodness, y'all turn every meme post to a tech discussion. There are subs for that.
I've not used the exact syntax. Playwright is definitely much better than my previous application - Testcomplete. That gave me enough PTSD to last a lifetime
Allow me to introduce you to Tricentis Tosca. Legends tells that they tried to sell it as torture method, but even the folks at Guantanamo Bay refused, as it would have been too inhuman to make prisoners use that. So, they found the only company that doesn’t mind such things as humanity or sanity, and partnered with them. And thats how you get Testautomation for SAP.
Had a ghost hunt with Selenium for the same reason.
Element is visible. Element is scrolled to, but can you click it? Nah, click intercepted by a sticky header. No javascript I tried stuffing in there could scroll the damn button into focus either. Nevermind the exact width of the header as a point of orientation as to where I need the button to be.
The solution will shock you I had navigated to a fake-anchor (actually just a query) previously and that had changed the scrolling behaviour of the website for Selenium. Navigate to the base URL and suddenly everything works. I will nail this board to my forehead myself thank you
I think it's a long time since I laughed that much to an "overused" meme format. That "is clickable" looks to be filler to match the format, but I just KNOW that it actually HAS to be there in real situations. I can hear and feel the annoyance in that line of "you won't loophole me this ti- oh dammit." , and it matches ManRay's smile* so much as a bonus.
(I don't know Playwright but I have PTSD from Selenium. WHAT DO YOU MEAN there's an invisible object in front of the button's pixel position??? My mouse can highlight and click it just fine, click it!)
[EDIT] *I learned today that in the US the character is called Man Ray to match Bernacle Boy and Mermaid Man. In French the two heroes are direct translations, but the supervillain is called "Dark Glasses"... I mean his mask is the shape of a manta ray, so why didn't they- ooooh. NSFW tangent a ray/raie is slang for a butt's crack
i had this problem with playwright when the button was in a menu in a drawer. So it had a combo of all things that scare playwright: css transforms & transitions (which turn on gpu acceleration and make it especially confused), fixed positioning, menu mounting in an awkward way, having to scroll within the drawer. I thought i managed to make it all work by setting specific timeouts and pixel values, everything passed locally without issues every time, but then it was failing 20% of the time when running in ci
i quietly removed that test after this piece of ui became stable and everyone who noticed thanked me
if you were going to ask, claude failed to accomplish even the flaky-but-working version of the test, it looked like claude was going to have a mental breakdown outputting text in all caps and such, so i did it by hand to avoid stressing out the poor model
I see all the folks here claiming selenium was the devil incarnate and just know they never had to experience Winium. Imagine for a moment the pure horror of selenium but the DOM contains not only the webpage, but the entire browser and every other open application and the windows desktop. I once had to test an application using winium that opened to a splash screen while the data loaded (for between 3 and 10 minutes) then threw a login window before opening the actual window. Each window had the same app name, pid and window name. So what? The windows replaced each other I hear you say. Nope each window stayed in the dom, just hidden. Could I grab the window by calling window[i]? Yep. Was the index reliable? Was it fuck. I had to identify and grab each window by finding a known element on it. The login window had an named field I could hook into and the window had a toolbar.
I just code GUI tests in the same language as the project. So TestMyApp *sees* the MyApp instance, and can directly access the OK button. Writing tests and debugging them is *so* much nicer this way.
And the same for unit tests, plus a 25-line testing 'framework' to find all tests and fire them off automaticatically.
371
u/purbub Oct 20 '26
Relatable. UI testing was really frustrating back then
115
u/SuitableDragonfly Oct 20 '26
If, when stuff like this happens, you spend some time talking to your cat about why you think it should be working instead of making a meme, you'll actually figure out what's wrong.
16
u/Ange1ofD4rkness Oct 20 '26 •
My eye is twitching just thinking about that debugging session
19
u/LordAmir5 Oct 20 '26
I have no idea what a Playwright is. But click being a method of a Locator seems like bad design. Shouldn't a locator have a locate method instead?
53
u/midtownmoron Oct 20 '26 •
Had a ghost hunt with Selenium for the same reason.
Element is visible. Element is scrolled to, but can you click it? Nah, click intercepted by a sticky header. No javascript I tried stuffing in there could scroll the damn button into focus either. Nevermind the exact width of the header as a point of orientation as to where I need the button to be.
The solution will shock you I had navigated to a fake-anchor (actually just a query) previously and that had changed the scrolling behaviour of the website for Selenium. Navigate to the base URL and suddenly everything works. I will nail this board to my forehead myself thank you
158
u/laplongejr Oct 20 '26 edited Oct 20 '26
I think it's a long time since I laughed that much to an "overused" meme format. That "is clickable" looks to be filler to match the format, but I just KNOW that it actually HAS to be there in real situations. I can hear and feel the annoyance in that line of "you won't loophole me this ti- oh dammit." , and it matches ManRay's smile* so much as a bonus.
(I don't know Playwright but I have PTSD from Selenium. WHAT DO YOU MEAN there's an invisible object in front of the button's pixel position??? My mouse can highlight and click it just fine, click it!)
[EDIT] *I learned today that in the US the character is called Man Ray to match Bernacle Boy and Mermaid Man. In French the two heroes are direct translations, but the supervillain is called "Dark Glasses"... I mean his mask is the shape of a manta ray, so why didn't they- ooooh. NSFW tangent a ray/raie is slang for a butt's crack
14
u/korneev123123 Oct 20 '26
It's not an "OK" button, it is "info" button with "OK" text in it. Completelt different thing.
5
u/Highborn_Hellest Oct 20 '26
Step1: have this issue
Step2: call the software engineer who made this on steam, to please add an ID to the object.
Step3: locate by id.
5
u/therealdan0 Oct 20 '26
I see all the folks here claiming selenium was the devil incarnate and just know they never had to experience Winium. Imagine for a moment the pure horror of selenium but the DOM contains not only the webpage, but the entire browser and every other open application and the windows desktop. I once had to test an application using winium that opened to a splash screen while the data loaded (for between 3 and 10 minutes) then threw a login window before opening the actual window. Each window had the same app name, pid and window name. So what? The windows replaced each other I hear you say. Nope each window stayed in the dom, just hidden. Could I grab the window by calling window[i]? Yep. Was the index reliable? Was it fuck. I had to identify and grab each window by finding a known element on it. The login window had an named field I could hook into and the window had a toolbar.
4
u/an_agreeing_dothraki Oct 20 '26
alert(responseToJSJoke);
"object Object"
3
u/Altruistic-Tax-5291 Oct 20 '26
Send like not a lot of people remember the times before Playwright 😄 I think that's the second good tool MS invent after TypeScript
1
u/afellowpadawan Oct 20 '26
This is me with blazer interactivity models (I never know where shit renders lol)
1
u/chatrep Oct 20 '26
But what about hover and mobile?
1
u/Important_Grab3544 Oct 21 '26
Internet Explorer-like meme.
1
u/SchokoladeMitRavioli Oct 20 '26
Removing all my ui tests cured my depression.
0
u/Smalltalker-80 Oct 20 '26 edited Oct 23 '26
I just code GUI tests in the same language as the project.
So TestMyApp *sees* the MyApp instance, and can directly access the OK button.
Writing tests and debugging them is *so* much nicer this way.
And the same for unit tests, plus a 25-line testing 'framework'
to find all tests and fire them off automaticatically.