Click here to Skip to main content
15,886,799 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralDeficient Vocabulary // Assistance Welcome Pin
C-P-User-315-May-22 6:10
C-P-User-315-May-22 6:10 
GeneralRe: Deficient Vocabulary // Assistance Welcome Pin
OriginalGriff15-May-22 6:35
mveOriginalGriff15-May-22 6:35 
GeneralRe: Deficient Vocabulary // Assistance Welcome Pin
Marc Clifton15-May-22 7:10
mvaMarc Clifton15-May-22 7:10 
GeneralRe: Deficient Vocabulary // Assistance Welcome Pin
C-P-User-315-May-22 8:08
C-P-User-315-May-22 8:08 
GeneralRe: Deficient Vocabulary // Assistance Welcome Pin
Jörgen Andersson15-May-22 20:22
professionalJörgen Andersson15-May-22 20:22 
GeneralRe: Deficient Vocabulary // Assistance Welcome Pin
David O'Neil15-May-22 7:22
professionalDavid O'Neil15-May-22 7:22 
GeneralRe: Deficient Vocabulary // Assistance Welcome Pin
C-P-User-320-Jul-22 1:07
C-P-User-320-Jul-22 1:07 
GeneralSelenium is kinda a pain in the A*S Pin
#realJSOP15-May-22 5:32
mve#realJSOP15-May-22 5:32 
Learning Selenium for a new job that starts on the 23rd...

0) When you call driver.Quit, it's supposed to kill the driver process (running in windows), but it doesn't. This statement is true for both chrome and firefox. I had to write code to kill the associated processes for both the driver and the browser. What's worse, the chrome driver (of which multiple are spawned) will throw a Access Denied exception when you try to kill the chromedriver process, so you have to eat exceptions thrown by the Process.Kill() method top avoid failing the test simply because you're killing their freakin' process spawnage. (Firefox does not exhibit this problem, FWIW).

1) Selenium does not like element IDs that contain hyphens, so instead of doing By.Id(), I have to do By.CssSelector() to find an element by ID. Lesson - always use ByCssSelector for finding by ID.

I came up with a TestBase class that handles the process cleanup, a TestMaster class (derived from TestBase) that contains the browser-agnostic test methods, and finally, two browse-specific test classes that inherit from TestMaster.

The test method in TestMaster simply navigates to my own home page, makes sure the title is correct, and then finds/clicks a menu item, and checks to see if a specific section exists. Simple, but a decent exercise. This means I can test for pretty much any browser that is configured in the BaseTest class - I'm running Win7 with Firefox and Chrome installed in a VM, so I don't have Edge, but I could add Opera and Brave if there are drivers for them.

I suppose that despite its quirks, Selenium is a decent automation test tool. I think I'm going to see if the @Marc-Clifton Fluent Web API Integration Testing[^] can be wrangled into this stuff...
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

GeneralRe: Selenium is kinda a pain in the A*S Pin
Richard Andrew x6415-May-22 7:11
professionalRichard Andrew x6415-May-22 7:11 
GeneralRe: Selenium is kinda a pain in the A*S Pin
#realJSOP15-May-22 9:48
mve#realJSOP15-May-22 9:48 
GeneralRe: Selenium is kinda a pain in the A*S Pin
Dave Kreskowiak15-May-22 10:51
mveDave Kreskowiak15-May-22 10:51 
GeneralRe: Selenium is kinda a pain in the A*S Pin
Marc Clifton15-May-22 7:11
mvaMarc Clifton15-May-22 7:11 
GeneralSo about that thing I was doing yesterday... Pin
Sander Rossel14-May-22 23:53
professionalSander Rossel14-May-22 23:53 
GeneralAnother Assembly Guide Pin
glennPattonWork314-May-22 23:30
professionalglennPattonWork314-May-22 23:30 
GeneralRe: Another Assembly Guide Pin
RickZeeland15-May-22 1:55
mveRickZeeland15-May-22 1:55 
GeneralRe: Another Assembly Guide Pin
glennPattonWork315-May-22 5:06
professionalglennPattonWork315-May-22 5:06 
GeneralRe: Another Assembly Guide Pin
11917640 Member 15-May-22 2:17
11917640 Member 15-May-22 2:17 
GeneralRe: Another Assembly Guide Pin
Peter_in_278015-May-22 2:51
professionalPeter_in_278015-May-22 2:51 
GeneralRe: Another Assembly Guide Pin
honey the codewitch15-May-22 4:15
mvahoney the codewitch15-May-22 4:15 
GeneralRe: Another Assembly Guide Pin
glennPattonWork315-May-22 5:03
professionalglennPattonWork315-May-22 5:03 
GeneralRe: Another Assembly Guide Pin
sasadler16-May-22 6:09
sasadler16-May-22 6:09 
GeneralRe: Another Assembly Guide Pin
Peter_in_278015-May-22 20:25
professionalPeter_in_278015-May-22 20:25 
GeneralRe: Another Assembly Guide Pin
honey the codewitch15-May-22 20:48
mvahoney the codewitch15-May-22 20:48 
GeneralRe: Another Assembly Guide Pin
User 1052936016-May-22 23:11
User 1052936016-May-22 23:11 
GeneralRe: Another Assembly Guide Pin
honey the codewitch16-May-22 23:45
mvahoney the codewitch16-May-22 23:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.