Author Archives: admin_isaac

List of All HyperRev Issues Vol 1 – 225 (1993-2018)

I’ve spent the last few days compiling a list of all HyperRev main-volume issues since this list seemed quite difficult to track down. HyperRev books are Japanese-language-only car publications that focused on a specific car for each issue and discusses tuning options for chassis, engine, wheels, etc.

hyperrev magaize

Example of a typical HyperRev cover

Volume Manufacturer Model Number Publish Date ISBN
1 Mazda Eunos Roadster 1 09/21/93 4991618120012
2 Nissan Silvia / 180SX S13/14 1 02/12/94 4991618120029
3 Nissan Skyline GT-R 1 08/19/94 4991618120036
4 Toyota Supra 70/80 JZ/GA 1 11/10/94 4991618120043
5 Subaru Legacy Touring Wagon 1 01/27/95 4991618120050
6 Mazda RX-7 FD/FC 1 03/29/95 4991618120067
7 Honda Civic / CR-X EG/EF 1 06/02/95 4991618120074
8 Nissan 180SX S13 1 07/28/95 4991618120081
9 Honda Accord Wagon CE1/CB9 1 09/29/95 4991618120098
10 Mitsubishi Pajero 1 10/27/95 4991618120104
11 Nissan Skyline GTS-t R32/R33 1 11/29/95 4991618120111
12 Subaru Impreza Sedan / Sports Wagon 1 01/31/96 4991618120128
13 Honda Odyssey 1 03/16/96 4938495368
14 Mazda Eunos Roadster 2 04/30/96 4938495376
15 Nissan Skyline GT-R R32/R33 2 05/31/96 4938495384
16 Toyota Hilux Surf 1 06/28/96 4938495392
17 Mitsubishi Lancer Evolution 1 – 4 1 08/08/96 4938495414
18 Toyota Levin/Trueno AE86/92/101/111 1 09/30/96 4991618120180
19 Nissan Silvia S13/S14 2 11/29/96 4938495430
20 Nissan Cedric/Gloria 1 01/31/97 4938495465
21 Toyota MR2 1 04/04/97 4938495473
22 Suzuki Wagon R 1 05/31/97 493849549
23 Mazda RX-7 FD/FC 2 06/30/97 493849552X
24 Subaru Legacy Touring Wagon / Sedan 2 07/31/97 4938495546
25 Nissan Fairlady Z 1 09/30/97 4938495570
26 Toyota MarkII / Chaser / Cresta 1 11/27/97 4938495600
27 Honda Integra 1 01/31/98 4938495619
28 Subaru Impreza 2 03/26/98 4938495619
29 Toyota Supra 70/80 JZ/GA 2 05/27/98 4938495651
30 Toyota Celica 1 07/27/98 4938495678
31 Honda Civic/CR-X EF/EG/EK 2 09/28/98 4938495716
32 Honda NSX 1 10/27/98 4938495724
33 Mitsubishi Lancer Evolution 1 – 5 2 01/11/99 4938495775
34 Toyota Aristo 1 03/01/99 4938495813
35 Toyota Soarer 1 03/27/99 4938495856
36 Toyota Celsior 1 04/27/99 4938495880
37 Nissan Skyline GTS-t/25GT Turbo R32/33/34 2 05/27/99 4938495910
38 Nissan Stagea 1 06/28/99 4938495120
39 Toyota Land Cruiser Prado 1 08/07/99 4938495163
40 Subaru Legacy 3 09/04/99 4938495198
41 Subaru Forester 1 09/25/99 4938495228
42 Nissan Primera 1 10/15/99 4938495252
43 Toyota Altezza 1 11/25/99 4938495295
44 Toyota Starlet 1 01/15/00 4891070048
45 Suzuki Jimny 1 02/09/00 4891070102
46 Honda S2000 1 03/02/00 4891070129
47 Toyota Vitz 1 03/31/00 4891070153
48 Toyota Levin/Trueno AE86/92/101/111 2 04/22/00 489107017X
49 Nissan Silvia S13/14/15 3 06/02/00 4891070234
50 Toyota MR2 2 07/01/00 4891070307
51 Mazda Roadster 3 07/31/00 4891070366
52 Nissan March 1 09/02/00 4891070374
53 Suzuki Escudo 1 10/03/00 4891070412
54 Mazda RX-7 FD/FC 3 11/10/00 4891070501
55 Toyota MarkII / Chaser / Cresta 2 12/01/00 4891070587
56 Nissan GT-R R32 1 01/12/01 4991618120562
57 Nissan GT-R R33 1 02/02/01 489107065X
58 Nissan GT-R R33 1 03/02/01 4891070706
59 Subaru Impreza 3 04/06/01 4891070714
60 Nissan Skyline GTS-t/25GT Turbo R32/33/34 3 05/11/01 4891070781
61 Mitsubishi Lancer Evolution 1 – 7 3 06/01/01 4891070838
62 Honda Integra 2 08/02/01 4891070900
63 Toyota MR-S 1 09/01/01 4891070951
64 Toyota Altezza 2 10/05/01 4891071036
65 Subaru Legacy 4 11/02/01 4891071079
66 Honda Civic EG/EK/EP3 3 12/01/01 4891071117
67 Nissan Stagea 2 01/11/02 4891071214
68 Nissan Silvia / 180SX S13/14/15 4 02/01/02 4891071230
69 Toyota Aristo 2 03/01/02 4891071281
70 Toyota Supra 70/80 JZ/GA 3 04/05/02 4891071338
71 Toyota Levin/Trueno AE86/92/101/111 4 05/02/02 4891071354
72 Mazda RX-7 FD/FC 4 06/01/02 4891071400
73 Mazda Roadster 4 07/05/02 4891071435
74 Subaru Impreza GC8 1 7/31/02 4891071478
75 Subaru Forester 2 09/06/02 4891071605
76 Honda S2000 2 11/01/02 4891071656
77 Honda Integra DC2/5 3 12/06/02 4891071702
78 Toyota Land Cruiser Prado 2 12/07/02 4891071745
79 Toyota Vitz 2 01/10/03 4891071877
80 Honda Fit 1 02/07/03 4891071885
81 Mitsubishi Lancer Evolution 1 – 8 4 03/07/03 4891071893
82 Nissan Fairlady Z Z32/33 2 04/04/03 4891071907
83 Honda Accord 1 05/02/02 4891071915
84 Subaru Impreza GD/GG 1 06/06/03 4891072075
85 Nissan Silvia / 180SX S13/14/15 5 07/04/03 489107213X
86 Toyota MarkII / Chaser / Cresta 3 08/01/03 4891072156
87 Toyota Celica 2 09/05/03 4891072180
88 Subaru Legacy 5 10/03/03 4891072199
89 Nissan Skyline 350GT/GTS-t/25GT Turbo R32/33/34 4 11/07/03 4891072210
90 Nissan Skyline GT-R R32/33/34 3 12/05/03 4891072229
91 Mazda RX-7 FD/FC 5 01/09/04 4891072237
92 Mazda Roadster NA/NB 5 02/06/04 4891072245
93 Honda NSX NA1/NA2 2 03/05/04 4891072253
94 Honda Civic EG/EK/EP3 4 04/02/04 4891072261
95 Mitsubishi Lancer Evolution 4 – 8 5 05/07/04 4891072679
96 Mazda RX-8 1 06/04/04 4891072709
97 Honda S2000 3 07/16/04 4891072776
98 Toyota Altezza 3 09/10/04 4891072873
99 Daihatsu Copen 1 10/22/04 4891072881
100 Nissan Skyline GT-R R32/33/34 4 10/20/04 4891073039
101 Nissan Fairlady Z Z33 3 02/17/05 4891073187
102 Nissan Silvia / 180SX S13/14 6 03/31/05 4891073225
103 Mitsubishi Lancer Evolution 9 6 05/19/05 4891073322
104 Nissan March 2 06/30/05 4891073373
105 Honda Integra DC5 4 08/26/05 4891073446
106 Subaru Legacy 6 09/30/05 4891073535
107 Subaru Impreza GDB/GC8 4 10/28/05 Unknown
108 Toyota Vitz 3 12/22/05 4891073713
109 Nissan Skyline GT-R R32/33/34 5 03/30/06 489107390X
110 Mazda RX-8 2 04/28/06 4891073985
111 Mazda Roadster NA/NB/NC 6 05/31/06 4891074000
112 Honda S2000 AP1/AP2 4 06/30/06 489107406X
113 Nissan Silvia / 180SX S13/14/15 7 08/26/06 4891074159
114 Daihatsu Copen 2 09/28/06 4891074272
115 Subaru Impreza 5 10/30/06 4891074353
116 Toyota Aristo 3 11/30/06 489107440X
117 Mitsubishi Lancer Evolution 7 – 9 7 12/21/06 4891074434
118 Subaru Legacy 7 01/31/07 9784891074517
119 Honda Fit 2 03/02/07 9784891074579
120 Nissan Skyline GT-R R32/33/34 6 03/30/07 9784891074647
121 Suzuki Swift 1 04/20/07 9784891074692
122 Nissan Fairlady Z Z33 4 06/15/07 9784891074777
123 Mazda RX-7 FD 6 07/20/07 9784891074814
124 Honda Civic EP3 – F+ 5 08/31/07 9784891074883
125 Nissan Silvia S15 8 10/29/07 9784891075040
126 Honda Integra DC2/5 5 11/16/07 9784891075187
127 Mazda RX-8 (40th Anniversary of Rotary) 3 12/14/07 9784891075194
128 Subaru Impreza GDB/GRB 6 01/31/08 9784891075248
129 Mitsubishi Lance Evolution CZ4A/CT9A/X 8 02/22/08 9784891075330
130 Subaru Legacy 8 03/26/08 9784891075361
131 Honda S2000 AP1/AP2 & CR 5 03/31/08 9784891075378
132 Nissan Skyline GT-R R32/33/34 7 04/30/08 9784891075484
133 Daihatsu Copen 3 06/27/08 9784891075576
134 Toyota MarkII / Chaser / Cresta 4 07/30/08 9784891075620
135 Suzuki Swift 2 08/29/08 9784891075750
136 Toyota Prius 1 11/17/08 9784891075804
137 Nissan Skyline V35/36 5 12/12/08 9784891075873
138 BMW Mini 1 12/18/08 9784891075941
139 Honda Civic/CR-X EF – FD 6 03/06/09 9784779605871
140 Subaru Impreza GD/GR 7 04/30/09 9784779606113
141 Mitsubishi Lance Evolution CZ4A/CT9A/X (First of new cover design) 9 05/26/09 9784779606267
142 Suzuki Swift 3 06/26/09 9784779606465
143 Honda S2000 AP1/AP2 6 08/26/09 9784779606618
144 Mazda RX-7 FD 1 10/26/09 9784779607585
145 Subaru Legacy 9 11/26/09 9784779607776
146 Nissan Fairlady Z Z33/Z34 5 12/04/09 9784779608094
147 Honda Beat 1 01/15/10 9784779608230
148 Honda Civic/CR-X EF/EG/EK & Integra DC/DB 1 03/05/10 9784779608629
149 Mazda Roadster NA/NB 1 03/31/10 9784779608759
150 Nissan Silvia / 180SX S13/14/15 9 05/31/10 9784779609299
151 Suzuki Jimny 2 08/26/10 9784779609701
152 Honda Fit 3 10/26/10 9784779610165
153 Suzuki Cappuccino 1 11/26/10 9784779610721
154 Honda CR-Z 1 12/25/10 9784779611070
155 Nissan Skyline GT-R R32 2 01/15/11 9784779611308
156 Toyota Crown 1 02/28/11 9784779611698
157 Mitsubishi Delica 1 05/26/11 9784779612244
158 BMW Mini 2 07/30/11 9784779612497
159 Mazda Roadster NA/NB/NC 7 08/31/11 9784779612824
160 Honda CR-Z 2 10/26/11 9784779613159
161 Mitsubishi Lancer Evolution 10 12/26/11 9784779613807
162 Subaru Impreza GC/GD/GR/DV 8 02/25/12 9784779614217
163 Nissan Fairlady Z Z33/Z34 (35th Anniversary) 6 04/26/12 9784779614392
164 Nissan Silvia / 180SX 10 06/30/12 9784779615191
165 Mazda RX-8 4 07/30/12 9784779615405
166 Honda S2000 AP1/AP2 7 10/26/12 9784779616181
167 Suzuki Swift 4 11/26/12 9784779616440
168 Daihatsu Copen 4 12/26/12 9784779616785
169 Toyota / Subaru 86/BRZ 1 01/31/13 9784779616938
170 Subaru Legacy 10 04/26/13 9784779617652
171 BMW Mini 3 05/31/13 9784779618123
172 Mitsubishi Lancer Evolution 11 06/26/13 9784779618536
173 Toyota / Subaru 86/BRZ 2 07/31/13 9784779618680
174 Honda Civic EG6/EK9/EP3/FD2/FN2 / Integra DC2/DB9/DC5 1 09/26/13 9784779619267
175 Suzuki Jimny 3 09/30/13 9784779619182
176 Subaru Impreza GDB/GDA/GRB/GRF/GH8/GGB/GGA/GVB/GVF 9 10/26/13 9784779619502
177 Suzuki Swift 5 12/26/13 9784779620287
178 Toyota / Subaru 86/BRZ 3 01/31/14 9784779620720
179 Nissan GT-R 1 04/10/14 9784779621536
180 Mazda RX-7 FD3S 1 04/26/14 9784779621543
181 Volkswagen Golf 1 05/26/14 9784779621802
182 Toyota FJ Cruiser 1 6/302/14 9784779622052
183 Toyota / Subaru 86/BRZ 4 07/31/14 9784779622656
184 Honda Fit 4 09/26/14 9784779622878
185 Nissan Silvia / 180SX 11 10/25/14 9784779623158
186 Nissan Fairlady Z Z33/Z34 7 11/29/14 9784779623837
187 Toyota Crown 2 11/29/14 9784779623509
188 Subaru Impreza 10 12/26/14 9784779623738
189 Subaru Levorg 1 01/31/15 9784779624193
190 Toyota / Subaru 86/BRZ 5 02/28/15 9784779624469
191 Suzuki Swift 6 03/31/15 9784779624797
192 Subaru Legacy 11 4/360/15 9784779625336
193 Honda NSX NA1/NA2 3 05/30/15 9784779625442
194 Toyota MarkII / Chaser / Cresta 5 06/30/15 9784779625640
195 Mitsubishi Lance Evolution CZ4A/CT9A 12 07/31/15 9784779625947
196 Toyota / Subaru 86/BRZ 6 08/31/15 9784779626166
197 Mazda RX-8 5 09/30/15 9784779626524
198 Daihatsu Copen 5 10/31/15 9784779626944
199 Subaru Impreza WRX 11 11/26/15 9784779627187
200 Nissan Skyline GT-R R32/33/34 8 11/30/15 9784779627194
201 Mazda Roadster NA/NB/NC/ND 8 12/26/15 9784779627668
202 Honda S2000 AP1/AP2 8 01/30/16 9784779627842
203 Nissan Fairlady Z Z34 8 02/29/16 9784779628016
204 Toyota / Subaru 86/BRZ 7 03/31/16 9784779628320
205 Honda Beat / S660 1 04/30/16 9784779628597
206 Nissan Silvia / 180SX 12 5/314/16 9784779629020
207 Suzuki Jimny 4 06/29/16 9784779629358
208 Subaru Levorg 2 06/30/16 9784779629532
209 Suzuki Swift 7 07/30/16 9784779629662
210 Honda Fit 5 08/31/16 9784779629983
211 Nissan GT-R 2 09/30/16 9784779630385
212 Mazda RX-7 FD3S 2 10/31/16 9784779630699
213 Subaru Impreza WRX 12 11/30/16 9784779631146
214 Toyota / Subaru 86/BRZ 8 12/26/16 9784779631412
215 Mazda Roadster NC/ND 9 12/28/16 9784779631429
216 Daihatsu Copen 6 02/28/17 9784779632082
217 Honda S660 1 3/314/17 9784779632303
218 BMW Mini 4 06/15/17 9784779632822
219 Toyota / Subaru 86/BRZ 9 06/29/17 9784779633041
220 Suzuki Alto Works 1 07/31/17 9784779633348
221 Nissan Fairlady Z 9 09/30/17 9784779633782
222 Subaru Impreza WRX 13 10/31/17 9784779634161
223 Suzuki Swift 8 11/30/17 9784779634581
224 Mazda Roadster ND / RF 10 12/29/17 9784779634949
225 Toyota / Subaru 86/BRZ 10 12/29/17 9784779634932

Creating a wifi signal strength detector with Arduino Uno

Arduino Wifi Strength Tester

Why:

I recently moved to a new house and have been struggling to set up our wireless to provide an even amount of wifi coverage to each area with the three devices I have (2 Airport Extremes, 1 Airport Express). I also recently started to dig back into the Arduino stuff now that I’m in the new house and finally have a dedicated space to lay out everything. This seemed to be fate – I had a problem to solve and needed a project at the same time. Below I’ll walk through the learning process and include the final project details.

Equipment used:

Arduino Uno R3

Adafruit ATWINC1500 Wifi Breakout Board

10k Ohm Breadboard Potentiometer

220 Ohm Resistor

16×2 LCD

Common Cathode RGB LED Breakout Board

Breadboard

Solderless Breadboard Wires

8AA Battery Pack

The Hardware Setup:

I first started out getting the wifi chip up and running using Adafruit’s excellent tutorial linked from their product page. Once everything was wired up, I installed the Wifi101 library found on GitHub in this Zip file of their master branch.

My Wifi Wiring:
  • ATWIN1500 ==> Arduino Uno R3
  • VIN ==> 5v
  • GND ==> Ground
  • SCK ==> D13
  • MISO ==> D12
  • MOSI ==> D11
  • CS ==> D10
  • EN ==> 5v
  • IRQ ==> D9
  • RST ==> D8
  • WAKE ==> Not Used
  • CFG ==> Not Used
  • RXTD ==> Not Used
  • TXD ==> Not Used

Next was opening up the Arduino IDE and loading up the CheckWiFi101FirmwareVersion sketch as instructed by Adafruit, making sure to set:

WiFi.setPins(8,7,4);

in void setup().

My firmware was 19.4.4 so I needed to update, which I did following these handy instructions. Great! I was now ready to go.

Having wired, installed and updated everything, I was able to start scanning for wifi, which could not be easier with the built-in examples in the WIFI101 library. I first ran the ScanNetworks sketch and then the ConnectWithWPA sketch. Both worked flawlessly and allowed me to see available networks and even connect to a website and download the page into the serial monitor. Web scraper anyone?

Next, start to customize the code to remove the need for the serial monitor so I don’t have to carry my laptop around with my setup. That means adding a LCD. Luckily I have a few of these on hand.

My 16×20 LCD Wiring:
  • SunFounder LCD1602 ==> Arduino Uno R3
  • VSS ==> Ground
  • CDD ==> 5v
  • V0 ==> 10k Potentiometer Wiper (center)
  • RS ==> D2
  • R/W ==> Ground
  • E ==> D3
  • D4 ==> Arduino D4
  • D5 ==> Arduino D5
  • D6 ==> Arduino D6
  • D7 ==> Arduino D7
  • A (LED Anode) ==> 220Ω ==> 5v (22.73mA)
  • K (LED GND) ==> Ground

LCD added, let’s add some code to make it work!

First, include the library at the top of the sketch:

#include <LiquidCrystal.h>

Then declare the pins you’re using for the LCD in the top of our sketch. In our case, we just need to declare the RS, E and Com pins like this:

LiquidCrystal lcd(2, 3, 4, 5, 6, 7);

The LCD setup is done and ready for instructions. But first lets also add a RGB LED so that we can also have an obvious visual indicator for when we’re making adjustments to the wifi from across the room, etc.

My Common Cathode LED Wiring:
  • LED Breakout ==> Arduino Uno R3
  • –  ==> Ground
  • R ==> A5
  • G ==> A4
  • B ==> A3

wifi_strength_tester_fritzing

The Code:

That’s it for hardware, let’s move on to the code, which is a mashup of lot’s of other tutorials, but really quite simple!

#include <LiquidCrystal.h> // needed to power the lcd screen
#include <SPI.h> // needed to communicate will everything
#include <WiFi101.h> // need to run the wifi chip


char ssid[] = "YOUR-WIFI-SSID-HERE"; // your network SSID (name)
char pass[] = "YOUR-WIFI-PASSWORD-HERE"; // your network password

int status = WL_IDLE_STATUS; 
WiFiServer server(80); 

LiquidCrystal lcd(2, 3, 4, 5, 6, 7); // set the pins used for the LCD(RS, E, Coms)

const int redPin = A5; // pin used for red pin of LED
const int greenPin = A4; // pin used for green pin of LED
const int bluePin = A3; // pin used for blue pin of LED

void setup() {
 // set up the LCD's number of columns and rows:
 lcd.begin(16, 2);
 
 pinMode(redPin, OUTPUT); // set A5 to output
 pinMode(greenPin, OUTPUT); // set A4 to output
 pinMode(bluePin, OUTPUT); // set A3 to output

 // set pins used for Wifi chip
 WiFi.setPins(10,9,8); 

 // initialize serial and wait for port to open:
 Serial.begin(9600); 

 // wait for serial port to connect. Needed for native USB port only
 while (!Serial) {
 ;
 }

 // check for the presence of the shield:
 if (WiFi.status() == WL_NO_SHIELD) {
 Serial.println("No wifi shield not present");
 // don't continue:
 while (true);
 }

 // attempt to connect to WiFi network:
 while (status != WL_CONNECTED) {
 lcd.setCursor(0,0); // set cursor to top/left most spot on the lcd
 lcd.print("Connecting to:"); // write message to lcd
 lcd.setCursor(0,1); // set cursor to bottom/left most spot on the lcd
 lcd.print(ssid); // write the name of your wifi network to lcd
 
 // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
 status = WiFi.begin(ssid, pass);

 // wait 10 seconds for connection:
 delay(10000);
 }
 server.begin();
}

void loop() {

 long rssi = WiFi.RSSI(); // sets signal strenth to variable rssi

 lcd.setCursor(4,0); // Set cursor to 5th spot on the top row
 lcd.print("Signal:"); // print message to lcd

 // in a loop, check the stregth of the signal and print it to the lcd
 // turn make the LED a corrosponding color
 
 // if strength is more than -50 it's excellent
 if (rssi > -50) {
 lcd.clear();
 lcd.setCursor(1,0);
 lcd.print("SGL: Excellent");
 color(0,255, 0); // green
 
 // or if strength is between -50 and -59 it's good
 } else if (rssi <= -50 && rssi >= -59) {
 lcd.clear();
 lcd.setCursor(4,0);
 lcd.print("SGL: Good");
 color(0, 0, 255); // blue

 // or if strength is between -60 and -69 it's fair
 } else if (rssi <= -60 && rssi >= -69) {
 lcd.clear();
 lcd.setCursor(4,0);
 lcd.print("SGL: Fair");
 color(237,109,0); // yellow-ish

 // or if strength is or less than -70 it's fair
 } else if (rssi <= -70) {
 lcd.clear();
 lcd.setCursor(4,0);
 lcd.print("SGL: Poor");
 color(255, 0, 0); // red
 }

 // print the acronym for decibel-milliwatts (dBm) 
 lcd.setCursor(4, 1);
 lcd.print(rssi);
 lcd.setCursor(8, 1);
 lcd.print("dBm");
 delay(1000);

}

// color function which tells the pins how to behave
void color (unsigned char red, unsigned char green, unsigned char blue) { 
 digitalWrite(redPin, red); 
 digitalWrite(bluePin, blue); 
 digitalWrite(greenPin, green); 
}

That’s it! Add your wifi ssid and password to:

char ssid[] = "YOUR-WIFI-SSID-HERE"; // your network SSID (name)
char pass[] = "YOUR-WIFI-PASSWORD-HERE"; // your network password

 (This is not secure, so don’t upload that to github without removing or obfuscating it)

Now go scan your house, garage, backyard, office, whatever! 

Early prototype testing:

Testing the WIFI!

Make webdriver wait for an element to become visible with Selenium Python

It’s a problem I’ve encountered many times: building out a test and getting to an element I need to click on or test its attributes or text only to find out that it’s being dynamically loaded by Javascript. When this happens I always get the same error in the console.

ElementNotVisibleException: Message: element not visible

It’s frustrating since virtually all help threads Ive found on Stack Overflow and on other blogs are close but never offered help that actually works. Maybe because my issue is not quite the same or because I write my tests differently, but truly I’ve never gotten any of those solutions to work. The following is a list of things that are either really bad ideas or just never worked for me:

  • Sleep the browser
  • Programmatically move the cursor 1px in order to find a button hit state
  • Injecting click actions into the browser developer console (ewww)
  • Use XPATH instead of CSS Locator
  • Get the size of the element first then click
  • etc

Finally just breaking down and looking at the Docs for Waits in Selenium/Python there, of course seems to be some promise. The example they give is as follows:

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver = webdriver.Firefox()
driver.get("http://somedomain/url_that_delays_loading")
try:
    element = WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.ID, "myDynamicElement"))
    )
finally:
    driver.quit()

Scanning the code quickly, I figured this was right up my alley. I copied the code, changed the placeholder element to the one I’m looking for, saved the file, rebuilt Docker, and ran the test. Same failure. Literally this code changed nothing. It didn’t wait, the element was still not visible and the test still failed. Ugg.

I read back through the code more thoroughly and noticed the Expected Condition line of

presence_of_element_located

which caught my eye. Presence. Ahh, right ok. My issue was not that the element was not present, which can also happen. My issue this time as you recall above was that the element was not Visible. Ok, dig deeper into the docs and look at the full list of Expected Conditions which are:

title_is
title_contains
presence_of_element_located
visibility_of_element_located
visibility_of
presence_of_all_elements_located
text_to_be_present_in_element
text_to_be_present_in_element_value
frame_to_be_available_and_switch_to_it
invisibility_of_element_located
element_to_be_clickable - it is Displayed and Enabled.
staleness_of
element_to_be_selected
element_located_to_be_selected
element_selection_state_to_be
element_located_selection_state_to_be
alert_is_present

Ahh, look at this. Visibility conditions. This is looking promising! Let’s make a quick change to something like:

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver = webdriver.Firefox()
driver.get("http://somedomain/url_that_delays_loading")
try:
    element = WebDriverWait(driver, 10).until(
        EC.visibility_of_element_located((By.ID, "myDynamicElement"))
    )
finally:
    driver.quit()

Save the file, rebuild Docker, run the test. While testing in our dev environment I have Docker run the test with a headed browser, usually Chrome or FF so I’m able to watch it run. This time around something is different. The test properly pauses while the page content is loading in dynamically then once loaded the test proceeded. Success! That was it.

Chrome inspector’s 0 variable

Ever noticed a little commented-out expression hanging off your code in Chrome’s inspector that looks something like ==$0?

Chrome Inspector 0 variable

Google Chrome’s inspector assigning the above line a variable of 0.

I have, but never gave it much mind. I finally thought I’d look into it today and wish I had a long time ago. Turns out what the expression means is that if you click on a line of code in the inspector or right click inspect an element the variable 0 gets assigned to that node and its children.

Calling this variable by typing $0 into the console of Chrome will then display just that node and its children. Super helpful if you’re like me and prefer to focus on certain lines or nodes without the clutter of everything else in the DOM.

Google Chrome console

By typing $0 into the console of the browser just the selected line of code in the inspector will display along with its children.

Pretty handy trick, right? Well, you can also use $1 $2 $3 $4 to go back and look at previous nodes that you inspected before the most current $0 inspection. Stack Overflow user deadlock, has the winning explanation here.

Tell Protractor where your Angular app lives, avoid sync issues

A handy trick (read: best practice) I ran into today was about how to properly inform Protractor where to look for your Angular application when it pols the DOM.

In my early Protractor tests I always started out with something like:

// ignore Angular and sync
beforeEach(function() {
    browser.ignoreSynchronization = true;
});

I have a few tests that need to run back and fourth between Angular and non-Angular pages and this worked in a pinch but I never really looked into the details of it.

Today while working on a new test that’s being extremely finicky, I needed to debug that line a bit and came across a great post by Vincent Tunru. In essence, adding a browser.ignoreSynchronization = true;  line to each test works, but in reality it’s better to simply tell protractor in your config file where your Angular app will exist and let it sort out whether or not there’s Angular on the page.

You can accomplish this by adding to your cons.js file the following:

exports.config = {
  
  rootElement: '*[ng-app]', 

  ...

Which will tell Protractor that your Angular app should be found on an element with the attribute of ng-app whether your Angular app is in the default body tag or most likely not.

Neat and much cleaner. Thanks, Vincent!