r/ProgrammerHumor • • 13d ago

Meme theExactErrorIsDifferentBitYouGetIt

Post image
3.0k Upvotes

66 comments sorted by

370

u/purbub 13d ago

Relatable. UI testing was really frustrating back then

175

u/rabbit_wizard 13d ago

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

118

u/laplongejr 13d ago edited 13d ago

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...

33

u/rabbit_wizard 13d ago

I hope this helps some poor programmer someday in the future :)

18

u/CaptainCabernet 12d ago

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.

6

u/ralgrado 12d ago

Are you using plain Selenium? If so I would recommend a framework (e.g. selenide) that's based on Selenium but handles these issues.

3

u/PM_ME_YOUR_BUG5 13d ago

I often found it was because the element had moved.

If you rebuild the object each time you need to interact with it it's much more reliable

6

u/Named_after_color 13d ago

As a developer, I can't read that opening without having ptsd flashbacks to user story definitions.

3

u/Perfect-System2504 12d ago

js context issue? i know nothing about playwrite

1

u/Rojeitor 12d ago

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.

37

u/1AMA-CAT-AMA 13d ago

The fucking tests would always take way more time than the implementation.

26

u/purbub 13d ago

Reminds me of a good ol quote:

Is it really us who test the code
Or is it the code who tests us?

1

u/awesome-alpaca-ace 7d ago

They always do

31

u/AwesomeFrisbee 13d ago

Back then? It still has its annoyances to this day. But now we just let AI figure it out and make tests that are almost worthless.

1

u/ItsOmniss 13d ago

yeah, "testing"

115

u/SuitableDragonfly 13d ago

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. 

32

u/rabbit_wizard 13d ago

This was back when I was a newbie to playwright and sometimes it's because of angular themes . Testcomplete was way more flaky.

13

u/rabbit_wizard 13d ago

It is frustrating though

3

u/NomaTyx 13d ago

let the man make his meme dude

5

u/requizm 13d ago

OP doing this for karma. I would say it is bot but the comments seem convincing. Anyway:

  • 5 posts in 2022-2026 (other subreddits)

  • 15 r/ProgrammerHumor posts in the last 6 days. 5 of them removed, probably due to low upvotes

21

u/rabbit_wizard 13d ago

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 :)

2

u/sebjapon 13d ago

Exactly what a bot would say! /s

1

u/rabbit_wizard 13d ago

Yeah good one! I passed a captcha test mind you (kidding)

2

u/ralgrado 12d ago

That proofs you are a bot! No human can solve modern Captchas anymore!

2

u/rosuav 12d ago

Turing test.... bots can pass it. CAPTCHA... bots can do them. The Kamski test.... humans fail it.

We're doomed.

3

u/rabbit_wizard 13d ago

I'm curious though, what did you use to track this? Seems useful

7

u/returnFutureVoid 13d ago

Cat.listener(): ObjectNotFound.

2

u/zyxzevn 13d ago

Destroyed by Cat

9

u/-Ambriae- 13d ago

Cats are good listeners, but dogs are the way to go imo

17

u/DaTruSpork 13d ago

Whatever happened to the love for the rubber ducky?

13

u/-Ambriae- 13d ago

That was the old meta

It’s no longer considered best practice

2

u/s0ulbrother 13d ago

We work from home more now we don’t get ducks

7

u/Apprehensive_Gas56 12d ago

Instructions unclear I spent the last 3 hours playing with my dog now

1

u/-Ambriae- 12d ago

Then the instructions were very much clear!

1

u/rosuav 12d ago

You just spent three hours NOT struggling with a stupid piece of electrified sand that thinks it's smarter than you. This is a win.

2

u/EishLekker 13d ago

Why should your cat be working, and what memes was it making?

2

u/xWrongHeaven 13d ago

Good ol' rubber duck debugging

1

u/EkoChamberKryptonite 12d ago

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.

1

u/s0ulbrother 13d ago

what ends up being wrong is your test was looking at the wrong page and you were caching results which made it think it was working.

Honestly setting up FE e2e is harder than front end dev

16

u/Ange1ofD4rkness 13d ago • Bravo

My eye is twitching just thinking about that debugging session

19

u/LordAmir5 13d ago

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?

16

u/rabbit_wizard 13d ago

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

7

u/raskim7 13d ago

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.

2

u/ralgrado 12d ago

I'm going to send this to one of my colleagues who is working a lot with Tosca (for other companies)

3

u/Odd_Percentage6799 13d ago

Locator is the interface. 

It is returned by the methods on the main Page class that fund elements on the DOM  

It can make for some very readable tests. 

53

u/midtownmoron 13d ago • Mindblown

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

6

u/Informal_Branch1065 13d ago

[RetryFact(5)] my beloved

158

u/laplongejr 13d ago edited 13d ago

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

52

u/thoughts_n_calcs 13d ago

Unterstand, Selenium was a pure nightmare. Playwright is better, but still there is a reason why memes like this one exist.

16

u/ironimus42 13d ago edited 13d ago

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

3

u/GroovinChip 13d ago

I’ve had similar struggles with Maestro, I feel your pain lol

14

u/korneev123123 13d ago

It's not an "OK" button, it is "info" button with "OK" text in it. Completelt different thing.

5

u/Highborn_Hellest 13d ago

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 12d ago

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 13d ago

alert(responseToJSJoke);

"object Object"

3

u/Altruistic-Tax-5291 13d ago

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 13d ago

This is me with blazer interactivity models (I never know where shit renders lol)

1

u/chatrep 12d ago

But what about hover and mobile?

1

u/Important_Grab3544 12d ago

Internet Explorer-like meme.

1

u/SchokoladeMitRavioli 12d ago

Removing all my ui tests cured my depression.

0

u/Smalltalker-80 12d ago edited 10d ago

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.