Merge pull request #5248 from solgenomics/topic/batch_update_trials
[sgn.git] / t / selenium2 / solgs / cluster.t
blob0dd64a2ad90669f033369c3512ad1124c89a5492
2 use strict;
4 use lib 't/lib';
6 use File::Spec::Functions qw / catfile catdir/;
7 use Test::More;
8 use SGN::Test::WWW::WebDriver;
9 use SGN::Test::Fixture;
10 use SGN::Test::solGSData;
12 my $d = SGN::Test::WWW::WebDriver->new();
13 my $f = SGN::Test::Fixture->new();
15 my $solgs_data = SGN::Test::solGSData->new(
16     {
17         'fixture'                => $f,
18         'accessions_list_subset' => 60,
19         'plots_list_subset'      => 60
20     }
23 my $cache_dir    = $solgs_data->site_cluster_shared_dir();
24 my $protocol_dir = $solgs_data->default_protocol_dir();
25 my $cluster_dir  = catdir( $protocol_dir, 'cluster' );
26 my $log_dir      = catdir( $protocol_dir, 'log' );
28 my $accessions_list = $solgs_data->load_accessions_list();
30 # my $accessions_list = $solgs_data->get_list_details('accessions');
31 my $accessions_list_name = $accessions_list->{list_name};
32 my $accessions_list_id   = 'list_' . $accessions_list->{list_id};
33 print STDERR
34   "\naccessions list: $accessions_list_name -- $accessions_list_id\n";
35 my $plots_list = $solgs_data->load_plots_list();
37 # my $plots_list =  $solgs_data->get_list_details('plots');
38 my $plots_list_name = $plots_list->{list_name};
39 my $plots_list_id   = 'list_' . $plots_list->{list_id};
41 print STDERR "\nadding trials list\n";
42 my $trials_list = $solgs_data->load_trials_list();
44 # my $trials_list =  $solgs_data->get_list_details('trials');
45 my $trials_list_name = $trials_list->{list_name};
46 my $trials_list_id   = 'list_' . $trials_list->{list_id};
47 print STDERR "\nadding trials dataset\n";
49 # my $trials_dt =  $solgs_data->get_dataset_details('trials');
50 my $trials_dt      = $solgs_data->load_trials_dataset();
51 my $trials_dt_name = $trials_dt->{dataset_name};
52 my $trials_dt_id   = 'dataset_' . $trials_dt->{dataset_id};
53 print STDERR "\nadding accessions dataset\n";
55 # my $accessions_dt =  $solgs_data->get_dataset_details('accessions');
56 my $accessions_dt      = $solgs_data->load_accessions_dataset();
57 my $accessions_dt_name = $accessions_dt->{dataset_name};
58 my $accessions_dt_id   = 'dataset_' . $accessions_dt->{dataset_id};
60 print STDERR "\nadding plots dataset\n";
62 # my $plots_dt =  $solgs_data->get_dataset_details('plots');
63 my $plots_dt      = $solgs_data->load_plots_dataset();
64 my $plots_dt_name = $plots_dt->{dataset_name};
65 my $plots_dt_id   = 'dataset_' . $plots_dt->{dataset_id};
67 #$accessions_dt_name = '' . $accessions_dt_name . '';
68 print STDERR "\ntrials dt: $trials_dt_name -- $trials_dt_id\n";
69 print STDERR "\naccessions dt: $accessions_dt_name -- $accessions_dt_id\n";
70 print STDERR "\nplots dt: $plots_dt_name -- $plots_dt_id\n";
72 print STDERR "\ntrials list: $trials_list_name -- $trials_list_id\n";
73 print STDERR
74   "\naccessions list: $accessions_list_name -- $accessions_list_id\n";
75 print STDERR "\nplots list: $plots_list_name -- $plots_list_id\n";
77 `rm -r $cache_dir`;
79 # `rm -r /tmp/localhost/GBSApeKIgenotypingv4/log/`;
81 $d->while_logged_in_as(
82     "submitter",
83     sub {
85         $d->get_ok( '/cluster/analysis', 'cluster home page' );
86         sleep(5);
87         $d->find_element_ok(
88             '//select[@id="cluster_pops_select"]/option[text()="'
89               . $accessions_list_name . '"]',
90             'xpath',
91             'select clones list'
92         )->click();
93         sleep(5);
94         $d->find_element_ok( '//input[@value="View"]', 'xpath', 'go btn' )
95           ->click();
96         sleep(5);
97         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
98             'xpath', 'select k-means' )->send_keys('K-means');
99         sleep(1);
100         $d->find_element_ok(
101 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
102             'xpath',
103             'select genotype'
104         )->click();
105         sleep(1);
106         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
107             'xpath', 'select k number' )->send_keys(4);
108         sleep(1);
109         $d->find_element_ok(
110             '//*[starts-with(@id, "run_cluster")]',
111             'xpath',
112             'run clones list (genotype) clustering'
113         )->click();
114         sleep(5);
115         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
116         sleep(60);
118         my $sel_pops = $d->find_element( '//*[contains(text(), "Select a")]',
119             'xpath', 'scroll up' );
120         my $elem = $d->driver->execute_script(
121             "arguments[0].scrollIntoView(true);window.scrollBy(0, -10);",
122             $sel_pops );
123         sleep(60);
124         $d->find_element_ok(
125             '//img[@id="k-means-plot-'
126               . $accessions_list_id
127               . '-genotype-k-4-gp-1"]',
128             'xpath',
129             'check k-means plot'
130         )->click();
131         sleep(5);
133         $d->driver->refresh();
134         sleep(3);
136         $d->find_element_ok(
137             '//select[@id="cluster_pops_select"]/option[text()="'
138               . $accessions_list_name . '"]',
139             'xpath',
140             'select clones list'
141         )->click();
142         sleep(5);
143         $d->find_element_ok( '//input[@value="View"]', 'xpath', 'go btn' )
144           ->click();
145         sleep(5);
146         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
147             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
148         sleep(1);
149         $d->find_element_ok(
150 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
151             'xpath',
152             'select genotype'
153         )->click();
154         sleep(1);
155         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
156             'xpath', 'run cluster' )->click();
157         sleep(5);
158         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
159         sleep(40);
161         my $sel_pops = $d->find_element( '//*[contains(text(), "Select")]',
162             'xpath', 'scroll up' );
163         my $elem = $d->driver->execute_script(
164             "arguments[0].scrollIntoView(true);window.scrollBy(0, 500);",
165             $sel_pops );
166         sleep(40);
167         $d->find_element_ok(
168             '//img[@id="hierarchical-plot-'
169               . $accessions_list_id
170               . '-genotype-gp-1"]',
171             'xpath',
172             'check hierarchical plot'
173         )->click();
174         sleep(5);
176         $d->driver->refresh();
177         sleep(3);
179         $d->find_element_ok(
180             '//select[@id="cluster_pops_select"]/option[text()="'
181               . $plots_list_name . '"]',
182             'xpath',
183             'select plots list'
184         )->click();
185         sleep(5);
186         $d->find_element_ok( '//input[@value="View"]', 'xpath', 'go btn' )
187           ->click();
188         sleep(5);
189         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
190             'xpath', 'select k-means' )->send_keys('K-means');
191         sleep(1);
192         $d->find_element_ok(
193 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Phenotype"]',
194             'xpath',
195             'select phenotype'
196         )->click();
197         sleep(1);
198         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
199             'xpath', 'select k number' )->send_keys(4);
200         sleep(1);
201         $d->find_element_ok(
202             '//*[starts-with(@id, "run_cluster")]',
203             'xpath',
204             'run plots list (phenotype) clustering'
205         )->click();
206         sleep(3);
207         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
208         sleep(60);
210         my $sel_pops = $d->find_element( '//*[contains(text(), "Select a")]',
211             'xpath', 'scroll up' );
212         my $elem = $d->driver->execute_script(
213             "arguments[0].scrollIntoView(true);window.scrollBy(0, -10);",
214             $sel_pops );
215         sleep(5);
216         $d->find_element_ok(
217             '//img[@id="k-means-plot-' . $plots_list_id . '-phenotype-k-4"]',
218             'xpath', 'check k-means plot' )->click();
219         sleep(5);
221         $d->driver->refresh();
222         sleep(3);
224         $d->find_element_ok(
225             '//select[@id="cluster_pops_select"]/option[text()="'
226               . $plots_list_name . '"]',
227             'xpath',
228             'select plots list'
229         )->click();
230         sleep(5);
231         $d->find_element_ok( '//input[@value="View"]', 'xpath', 'go btn' )
232           ->click();
233         sleep(5);
234         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
235             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
236         sleep(1);
237         $d->find_element_ok(
238 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Phenotype"]',
239             'xpath',
240             'select phenotype'
241         )->click();
242         sleep(1);
243         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
244             'xpath', 'run cluster' )->click();
245         sleep(3);
246         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
247         sleep(40);
249         my $sel_pops = $d->find_element( '//*[contains(text(), "Select a")]',
250             'xpath', 'scroll up' );
251         my $elem = $d->driver->execute_script(
252             "arguments[0].scrollIntoView(true);window.scrollBy(0, 500);",
253             $sel_pops );
254         sleep(5);
255         $d->find_element_ok(
256             '//img[@id="hierarchical-plot-' . $plots_list_id . '-phenotype"]',
257             'xpath', 'check hierarchical plot' )->click();
258         sleep(5);
260         $d->driver->refresh();
261         sleep(3);
263         $d->find_element_ok(
264             '//select[@id="cluster_pops_select"]/option[text()="'
265               . $trials_list_name . '"]',
266             'xpath',
267             'select trials list'
268         )->click();
269         sleep(5);
270         $d->find_element_ok( '//input[@value="View"]', 'xpath', 'go btn' )
271           ->click();
272         sleep(5);
273         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
274             'xpath', 'select k-means' )->send_keys('K-means');
275         sleep(1);
276         $d->find_element_ok(
277 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
278             'xpath',
279             'select genotype'
280         )->click();
281         sleep(1);
282         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
283             'xpath', 'select k number' )->send_keys(4);
284         sleep(1);
285         $d->find_element_ok(
286             '//*[starts-with(@id, "run_cluster")]',
287             'xpath',
288             'run trials list (genotype) clustering'
289         )->click();
290         sleep(3);
291         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
292         sleep(200);
294         my $sel_pops = $d->find_element( '//*[contains(text(), "Select a")]',
295             'xpath', 'scroll up' );
296         my $elem = $d->driver->execute_script(
297             "arguments[0].scrollIntoView(true);window.scrollBy(0, -10);",
298             $sel_pops );
299         sleep(5);
300         $d->find_element_ok(
301             '//img[@id="k-means-plot-'
302               . $trials_list_id
303               . '-genotype-k-4-gp-1"]',
304             'xpath',
305             'check k-means plot'
306         )->click();
307         sleep(5);
309         $d->driver->refresh();
310         sleep(3);
312         $d->find_element_ok(
313             '//select[@id="cluster_pops_select"]/option[text()="'
314               . $trials_list_name . '"]',
315             'xpath',
316             'select trials list'
317         )->click();
318         sleep(5);
319         $d->find_element_ok( '//input[@value="View"]', 'xpath', 'go btn' )
320           ->click();
321         sleep(5);
322         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
323             'xpath', 'select k-means' )->send_keys('K-means');
324         sleep(1);
325         $d->find_element_ok(
326 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Phenotype"]',
327             'xpath',
328             'select phenotype'
329         )->click();
330         sleep(1);
331         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
332             'xpath', 'select k number' )->send_keys(4);
333         sleep(1);
334         $d->find_element_ok(
335             '//*[starts-with(@id, "run_cluster")]',
336             'xpath',
337             'run trials list (phenotype) clustering'
338         )->click();
339         sleep(5);
340         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
341         sleep(100);
343         my $sel_pops = $d->find_element( '//*[contains(text(), "Select a")]',
344             'xpath', 'scroll up' );
345         my $elem = $d->driver->execute_script(
346             "arguments[0].scrollIntoView(true);window.scrollBy(0, -10);",
347             $sel_pops );
348         $d->find_element_ok(
349             '//img[@id="k-means-plot-' . $trials_list_id . '-phenotype-k-4"]',
350             'xpath', 'check k-means plot' )->click();
351         sleep(5);
353         $d->driver->refresh();
354         sleep(3);
356         $d->find_element_ok(
357             '//select[@id="cluster_pops_select"]/option[text()="'
358               . $trials_list_name . '"]',
359             'xpath',
360             'select trials list'
361         )->click();
362         sleep(5);
363         $d->find_element_ok( '//input[@value="View"]', 'xpath', 'go btn' )
364           ->click();
365         sleep(5);
366         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
367             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
368         sleep(1);
369         $d->find_element_ok(
370 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
371             'xpath',
372             'select genotype'
373         )->click();
374         sleep(1);
375         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
376             'xpath', 'run cluster' )->click();
377         sleep(3);
378         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
379         sleep(200);
381         my $sel_pops = $d->find_element( '//*[contains(text(), "Select a")]',
382             'xpath', 'scroll up' );
383         my $elem = $d->driver->execute_script(
384             "arguments[0].scrollIntoView(true);window.scrollBy(0, 600);",
385             $sel_pops );
387         $d->find_element_ok(
388             '//img[@id="hierarchical-plot-'
389               . $trials_list_id
390               . '-genotype-gp-1"]',
391             'xpath',
392             'check hierarchical plot'
393         )->click();
394         sleep(5);
396         $d->driver->refresh();
397         sleep(3);
399         `rm -r /tmp/localhost`;
400         sleep(5);
402         $d->find_element_ok(
403             '//select[@id="cluster_pops_select"]/option[text()="'
404               . $trials_list_name . '"]',
405             'xpath',
406             'select trials list'
407         )->click();
408         sleep(5);
409         $d->find_element_ok( '//input[@value="View"]', 'xpath', 'go btn' )
410           ->click();
411         sleep(5);
412         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
413             'xpath', 'select k-means' )->send_keys('K-means');
414         sleep(1);
415         $d->find_element_ok(
416 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Phenotype"]',
417             'xpath',
418             'select genotype'
419         )->click();
420         sleep(1);
421         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
422             'xpath', 'select k number' )->send_keys(4);
423         sleep(1);
424         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
425             'xpath', 'run cluster' )->click();
426         sleep(3);
427         $d->find_element_ok( 'queue_job', 'id', 'job queueing' )->click();
428         sleep(2);
429         $d->find_element_ok( 'analysis_name', 'id',
430             'trials list pheno analysis name' )
431           ->send_keys('trials list clustering');
432         sleep(2);
433         $d->find_element_ok( 'user_email', 'id', 'user email' )
434           ->send_keys('email@email.com');
435         sleep(2);
436         $d->find_element_ok( 'submit_job', 'id', 'submit' )->click();
437         sleep(200);
439         $d->driver->go_back();
440         sleep(5);
442         $d->find_element_ok(
443             '//select[@id="cluster_pops_select"]/option[text()="'
444               . $trials_list_name . '"]',
445             'xpath',
446             'select trials list'
447         )->click();
448         sleep(5);
449         $d->find_element_ok( '//input[@value="View"]', 'xpath', 'go btn' )
450           ->click();
451         sleep(5);
452         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
453             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
454         sleep(1);
455         $d->find_element_ok(
456 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Phenotype"]',
457             'xpath',
458             'select phenotype'
459         )->click();
460         sleep(1);
461         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
462             'xpath', 'run cluster' )->click();
463         sleep(5);
464         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
465         sleep(200);
467         my $sel_pops = $d->find_element( '//*[contains(text(), "Select a")]',
468             'xpath', 'scroll up' );
469         my $elem = $d->driver->execute_script(
470             "arguments[0].scrollIntoView(true);window.scrollBy(0, 500);",
471             $sel_pops );
472         $d->find_element_ok(
473             '//img[@id="hierarchical-plot-' . $trials_list_id . '-phenotype"]',
474             'xpath',
475             'check heirarchical plot'
476         )->click();
477         sleep(5);
479         $d->driver->refresh();
480         sleep(3);
482         $d->find_element_ok(
483             '//select[@id="cluster_pops_select"]/option[text()="'
484               . $trials_dt_name . '"]',
485             'xpath',
486             'select trials dataset'
487         )->click();
488         sleep(5);
489         $d->find_element_ok( '//input[@value="View"]', 'xpath', 'go btn' )
490           ->click();
491         sleep(5);
492         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
493             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
494         sleep(1);
495         $d->find_element_ok(
496 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Phenotype"]',
497             'xpath',
498             'select phenotype'
499         )->click();
500         sleep(1);
501         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
502             'xpath', 'run cluster' )->click();
503         sleep(3);
504         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
505         sleep(200);
507         my $sel_pops = $d->find_element( '//*[contains(text(), "Select a")]',
508             'xpath', 'scroll up' );
509         my $elem = $d->driver->execute_script(
510             "arguments[0].scrollIntoView(true);window.scrollBy(0, 500);",
511             $sel_pops );
512         sleep(5);
513         $d->find_element_ok(
514             '//img[@id="hierarchical-plot-' . $trials_dt_id . '-phenotype"]',
515             'xpath', 'check hierarchical plot' )->click();
516         sleep(5);
518         $d->driver->refresh();
519         sleep(3);
521         $d->find_element_ok(
522             '//select[@id="cluster_pops_select"]/option[text()="'
523               . $trials_list_name . '"]',
524             'xpath',
525             'select trials list'
526         )->click();
527         sleep(5);
528         $d->find_element_ok( '//input[@value="View"]', 'xpath', 'go btn' )
529           ->click();
530         sleep(5);
531         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
532             'xpath', 'select k-means' )->send_keys('K-means');
533         sleep(1);
534         $d->find_element_ok(
535 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Phenotype"]',
536             'xpath',
537             'select phenotype'
538         )->click();
539         sleep(1);
540         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
541             'xpath', 'select k number' )->send_keys(4);
542         sleep(1);
543         $d->find_element_ok(
544             '//*[starts-with(@id, "run_cluster")]',
545             'xpath',
546             'run trials list (pheno) cluster'
547         )->click();
548         sleep(5);
550         # $d->find_element_ok('no_queue', 'id', 'no job queueing')->click();
551         # sleep(60);
553         my $sel_pops = $d->find_element( '//*[contains(text(), "Select a")]',
554             'xpath', 'scroll up' );
555         my $elem = $d->driver->execute_script(
556             "arguments[0].scrollIntoView(true);window.scrollBy(0, -10);",
557             $sel_pops );
558         sleep(5);
559         $d->find_element_ok(
560             '//img[@id="k-means-plot-' . $trials_list_id . '-phenotype-k-4"]',
561             'xpath', 'check k-means plot' )->click();
562         sleep(5);
564         $d->driver->refresh();
565         sleep(3);
567         $d->find_element_ok(
568             '//select[@id="cluster_pops_select"]/option[text()="'
569               . $trials_dt_name . '"]',
570             'xpath',
571             'select trials dataset'
572         )->click();
573         sleep(5);
574         $d->find_element_ok( '//input[@value="View"]', 'xpath', 'go btn' )
575           ->click();
576         sleep(5);
577         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
578             'xpath', 'select k-means' )->send_keys('K-means');
579         sleep(1);
580         $d->find_element_ok(
581 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
582             'xpath',
583             'select genotype'
584         )->click();
585         sleep(1);
586         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
587             'xpath', 'select k number' )->send_keys(4);
588         sleep(1);
589         $d->find_element_ok(
590             '//*[starts-with(@id, "run_cluster")]',
591             'xpath',
592             'run trials dataset (genotype) cluster'
593         )->click();
594         sleep(3);
595         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
596         sleep(200);
598         my $sel_pops = $d->find_element( '//*[contains(text(), "Select a")]',
599             'xpath', 'scroll up' );
600         my $elem = $d->driver->execute_script(
601             "arguments[0].scrollIntoView(true);window.scrollBy(0, 500);",
602             $sel_pops );
603         sleep(2);
604         $d->find_element_ok(
605             '//img[@id="k-means-plot-' . $trials_dt_id . '-genotype-k-4-gp-1"]',
606             'xpath',
607             'plot displayed'
608         )->click();
609         sleep(5);
611         $d->driver->refresh();
612         sleep(3);
614         $d->find_element_ok(
615             '//select[@id="cluster_pops_select"]/option[text()="'
616               . $trials_dt_name . '"]',
617             'xpath',
618             'select trials dataset'
619         )->click();
620         sleep(5);
621         $d->find_element_ok( '//input[@value="View"]', 'xpath', 'go btn' )
622           ->click();
623         sleep(5);
624         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
625             'xpath', 'select k-means' )->send_keys('K-means');
626         sleep(1);
627         $d->find_element_ok(
628 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Phenotype"]',
629             'xpath',
630             'select phenotype'
631         )->click();
632         sleep(1);
633         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
634             'xpath', 'select k number' )->send_keys(4);
635         sleep(1);
636         $d->find_element_ok(
637             '//*[starts-with(@id, "run_cluster")]',
638             'xpath',
639             'run trials dataset (phenotype) cluster'
640         )->click();
641         sleep(3);
642         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
643         sleep(80);
645         my $sel_pops = $d->find_element( '//*[contains(text(), "Select a")]',
646             'xpath', 'scroll up' );
647         my $elem = $d->driver->execute_script(
648             "arguments[0].scrollIntoView(true);window.scrollBy(0, 500);",
649             $sel_pops );
650         sleep(5);
651         $d->find_element_ok(
652             '//img[@id="k-means-plot-' . $trials_dt_id . '-phenotype-k-4"]',
653             'xpath', 'check kmeans plot' )->click();
654         sleep(5);
656         `rm -r /tmp/localhost`;
657         sleep(5);
659         $d->get_ok( '/breeders/trial/139', 'trial detail home page' );
660         sleep(5);
662         my $analysis_tools = $d->find_element(
663             'Analysis Tools',
664             'partial_link_text',
665             'toogle analysis tools'
666         );
667         my $elem = $d->driver->execute_script(
668             "arguments[0].scrollIntoView(true);window.scrollBy(0,-50);",
669             $analysis_tools );
670         sleep(5);
671         $d->find_element_ok(
672             'Analysis Tools',
673             'partial_link_text',
674             'toogle analysis tools'
675         )->click();
676         sleep(5);
677         $d->find_element_ok( 'Clustering', 'partial_link_text',
678             'expand cluster sec' )->click();
679         sleep(5);
680         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
681             'xpath', 'select k-means' )->send_keys('K-means');
682         sleep(2);
683         $d->find_element_ok(
684 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Phenotype"]',
685             'xpath',
686             'select phenotype'
687         )->click();
688         sleep(2);
689         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
690             'xpath', 'select k number' )->send_keys(4);
691         sleep(2);
692         $d->find_element_ok(
693             '//*[starts-with(@id, "run_cluster")]',
694             'xpath',
695             'run phenotype cluster'
696         )->click();
697         sleep(3);
698         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
699         sleep(60);
700         $d->find_element_ok( '//img[@id="k-means-plot-139-phenotype-k-4"]',
701             'xpath', 'plot displayed' )->click();
702         sleep(5);
704         $d->driver->refresh();
705         sleep(5);
707         my $analysis_tools = $d->find_element(
708             'Analysis Tools',
709             'partial_link_text',
710             'toogle analysis tools'
711         );
712         my $elem = $d->driver->execute_script(
713             "arguments[0].scrollIntoView(true);window.scrollBy(0,-50);",
714             $analysis_tools );
715         sleep(5);
716         $d->find_element_ok(
717             'Analysis Tools',
718             'partial_link_text',
719             'toogle analysis tools'
720         )->click();
721         sleep(5);
722         $d->find_element_ok( 'Clustering', 'partial_link_text',
723             'expand cluster sec' )->click();
724         sleep(5);
725         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
726             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
727         sleep(2);
728         $d->find_element_ok(
729 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Phenotype"]',
730             'xpath',
731             'select phenotype'
732         )->click();
733         sleep(2);
734         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
735             'xpath', 'run cluster' )->click();
736         sleep(3);
737         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
738         sleep(130);
739         $d->find_element_ok( '//img[@id="hierarchical-plot-139-phenotype"]',
740             'xpath', 'plot displayed' )->click();
741         sleep(5);
743         $d->driver->refresh();
744         sleep(5);
746         my $analysis_tools =
747           $d->find_element( 'cluster_canvas', 'id', 'toogle analysis tools' );
748         my $elem = $d->driver->execute_script(
749             "arguments[0].scrollIntoView(true);window.scrollBy(0,-50);",
750             $analysis_tools );
751         sleep(5);
752         $d->find_element_ok(
753             'Analysis Tools',
754             'partial_link_text',
755             'toogle analysis tools'
756         )->click();
757         sleep(5);
758         $d->find_element_ok( 'Clustering', 'partial_link_text',
759             'expand cluster sec' )->click();
760         sleep(5);
761         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
762             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
763         sleep(1);
764         $d->find_element_ok(
765 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
766             'xpath',
767             'select genotype'
768         )->click();
769         sleep(1);
770         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
771             'xpath', 'run cluster' )->click();
772         sleep(3);
773         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
774         sleep(130);
775         $d->find_element_ok( '//img[@id="hierarchical-plot-139-genotype-gp-1"]',
776             'xpath', 'check hierarchical plot' )->click();
777         sleep(2);
779         $d->driver->refresh();
780         sleep(5);
782         my $analysis_tools =
783           $d->find_element( 'cluster_canvas', 'id', 'toogle analysis tools' );
784         my $elem = $d->driver->execute_script(
785             "arguments[0].scrollIntoView(true);window.scrollBy(0,-50);",
786             $analysis_tools );
787         sleep(5);
788         $d->find_element_ok(
789             'Analysis Tools',
790             'partial_link_text',
791             'toogle analysis tools'
792         )->click();
793         sleep(5);
794         $d->find_element_ok( 'Clustering', 'partial_link_text',
795             'expand cluster sec' )->click();
796         sleep(5);
797         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
798             'xpath', 'select k-means' )->send_keys('K-means');
799         sleep(1);
800         $d->find_element_ok(
801 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
802             'xpath',
803             'select genotype'
804         )->click();
805         sleep(1);
806         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
807             'xpath', 'clear k number' )->clear();
808         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
809             'xpath', 'select k number' )->send_keys(4);
810         sleep(1);
811         $d->find_element_ok(
812             '//*[starts-with(@id, "run_cluster")]',
813             'xpath',
814             'run genotype cluster'
815         )->click();
816         sleep(3);
817         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
818         sleep(80);
819         $d->find_element_ok( '//img[@id="k-means-plot-139-genotype-k-4-gp-1"]',
820             'xpath', 'check k-means plot' )->click();
821         sleep(2);
823         ############## solGS #####################
824         `rm -r $cache_dir`;
826         $d->get_ok( '/solgs', 'solgs homepage' );
827         sleep(4);
829         $d->find_element_ok( 'trial_search_box', 'id',
830             'population search form' )->send_keys('Kasese solgs trial');
831         sleep(5);
832         $d->find_element_ok( 'search_trial', 'id',
833             'search for training pop' )->click();
834         sleep(5);
835         $d->find_element_ok( 'Kasese', 'partial_link_text',
836             'create training pop' )->click();
837         sleep(5);
838         $d->find_element_ok( 'queue_job', 'id', 'submit job tr pop' )->click();
839         sleep(2);
840         $d->find_element_ok( 'analysis_name', 'id', 'training data job name' )
841           ->send_keys('Test Kasese Tr pop');
842         sleep(2);
843         $d->find_element_ok( 'user_email', 'id', 'user email' )
844           ->send_keys('email@email.com');
845         sleep(2);
846         $d->find_element_ok( 'submit_job', 'id', 'submit' )->click();
847         sleep(80);
848         $d->find_element_ok( 'Go back', 'partial_link_text', 'go back' )
849           ->click();
850         sleep(3);
852         $d->find_element_ok( 'trial_search_box', 'id',
853             'population search form' )->send_keys('Kasese solgs trial');
854         sleep(5);
855         $d->find_element_ok( 'search_trial', 'id',
856             'search for training pop' )->click();
857         sleep(5);
858         $d->find_element_ok( 'Kasese', 'partial_link_text',
859             'create training pop' )->click();
860         sleep(15);
862         $d->find_element_ok(
863             '//table[@id="population_traits_list"]/tbody/tr[1]/td/input',
864             'xpath', 'select 1st trait' )->click();
865         $d->find_element_ok(
866             '//table[@id="population_traits_list"]/tbody/tr[2]/td/input',
867             'xpath', 'select 2nd trait' )->click();
868         $d->find_element_ok( 'runGS', 'id', 'build multi models' )->click();
869         sleep(3);
870         $d->find_element_ok( 'queue_job', 'id', 'multi models job queueing' )
871           ->click();
872         sleep(2);
873         $d->find_element_ok( 'analysis_name', 'id', 'job name' )
874           ->send_keys('Test DMCP-FRW modeling  Kasese');
875         sleep(2);
876         $d->find_element_ok( 'user_email', 'id', 'user email' )
877           ->send_keys('email@email.com');
878         sleep(2);
879         $d->find_element_ok( 'submit_job', 'id', 'submit' )->click();
880         sleep(200);
881         $d->find_element_ok( 'Go back', 'partial_link_text', 'go back' )
882           ->click();
883         sleep(5);
885         $d->find_element_ok(
886             '//table[@id="population_traits_list"]/tbody/tr[1]/td/input',
887             'xpath', 'select 1st trait' )->click();
888         $d->find_element_ok(
889             '//table[@id="population_traits_list"]/tbody/tr[2]/td/input',
890             'xpath', 'select 2nd trait' )->click();
891         $d->find_element_ok( 'runGS', 'id', 'build multi models' )->click();
892         sleep(10);
894 #         # #
895 # ##############################################################
896 # # $d->get_ok('solgs/traits/all/population/139/traits/1971973596/gp/1', 'models page');
897 # #
898 # # sleep(15);
899 # #####################################################################
901         $d->find_element_ok( 'trial_search_box', 'id',
902             'population search form' )->send_keys('trial2 NaCRRI');
903         sleep(2);
904         $d->find_element_ok( 'search_selection_pop', 'id',
905             'search for selection pop' )->click();
906         sleep(30);
907         $d->find_element_ok(
908 '//table[@id="selection_pops_table"]//*[contains(text(), "Predict")]',
909             'xpath',
910             'click training pop'
911         )->click();
912         sleep(5);
913         $d->find_element_ok( 'queue_job', 'id', 'no job queueing' )->click();
914         sleep(2);
915         $d->find_element_ok( 'analysis_name', 'id',
916             'multi trials sel job name' )
917           ->send_keys('Test DMCP-FRW selection pred nacrri');
918         sleep(2);
919         $d->find_element_ok( 'user_email', 'id', 'user email' )
920           ->send_keys('email@email.com');
921         sleep(2);
922         $d->find_element_ok( 'submit_job', 'id', 'submit' )->click();
923         sleep(200);
924         $d->find_element_ok( 'Go back', 'partial_link_text', 'go back' )
925           ->click();
926         sleep(15);
928         $d->find_element_ok(
929 '//select[@id="list_type_selection_pops_select"]/option[text()="'
930               . $accessions_list_name . '"]',
931             'xpath',
932             'accessions list sl pop'
933         )->click();
934         sleep(5);
935         $d->find_element_ok( '//input[@value="View"]', 'xpath',
936             'select list sel pop' )->click();
937         sleep(5);
938         $d->find_element_ok(
939 '//table[@id="list_type_selection_pops_table"]//*[contains(text(), "Predict")]',
940             'xpath',
941             'click list sel pred'
942         )->click();
943         sleep(5);
944         $d->find_element_ok( 'queue_job', 'id', 'no job queueing' )->click();
945         sleep(2);
946         $d->find_element_ok( 'analysis_name', 'id', 'list sel job name' )
947           ->send_keys('clones list dmc-frw sel pred');
948         sleep(2);
949         $d->find_element_ok( 'user_email', 'id', 'user email' )
950           ->send_keys('email@email.com');
951         sleep(2);
952         $d->find_element_ok( 'submit_job', 'id', 'submit' )->click();
953         sleep(250);
954         $d->find_element_ok( 'Go back', 'partial_link_text', 'go back' )
955           ->click();
956         sleep(15);
958         $d->find_element_ok(
959 '//select[@id="list_type_selection_pops_select"]/option[text()="'
960               . $accessions_dt_name . '"]',
961             'xpath',
962             'accession select list sl pop'
963         )->click();
964         sleep(5);
965         $d->find_element_ok( '//input[@value="View"]', 'xpath',
966             'select dataset sel pop' )->click();
967         sleep(5);
968         $d->find_element_ok(
969 '//table[@id="list_type_selection_pops_table"]//*[contains(text(), "Predict")]',
970             'xpath',
971             'list sel pred'
972         )->click();
973         sleep(5);
974         $d->find_element_ok( 'queue_job', 'id', 'no job queueing' )->click();
975         sleep(2);
976         $d->find_element_ok( 'analysis_name', 'id', 'dataset sel job name' )
977           ->send_keys('dataset clones sel pred');
978         sleep(2);
979         $d->find_element_ok( 'user_email', 'id', 'user email' )
980           ->send_keys('email@email.com');
981         sleep(2);
982         $d->find_element_ok( 'submit_job', 'id', 'submit' )->click();
983         sleep(200);
984         $d->find_element_ok( 'Go back', 'partial_link_text', 'go back' )
985           ->click();
986         sleep(5);
988         my $sel_pops =
989           $d->find_element( 'Predict', 'partial_link_text', 'scroll up' );
990         my $elem = $d->driver->execute_script(
991             "arguments[0].scrollIntoView(true);window.scrollBy(0, -200);",
992             $sel_pops );
994         $d->find_element_ok(
995             '//div[ @id="list_type_selection_pop_go_btn"]/input[@value="View"]',
996             'xpath',
997             'select list sel pop'
998         )->click();
999         sleep(5);
1000         $d->find_element_ok( 'list_type_selection_pops_select',
1001             'id', 'select clones list menu' )->click();
1002         sleep(5);
1003         my $list = $d->find_element_ok(
1004 '//select[@id="list_type_selection_pops_select"]/option[text()="'
1005               . $accessions_list_name . '"]',
1006             'xpath',
1007             'select list sel pop'
1008         );
1009         $list->click();
1010         sleep(5);
1012         my $sel_pops =
1013           $d->find_element( 'Predict', 'partial_link_text', 'scroll up' );
1014         my $elem = $d->driver->execute_script(
1015             "arguments[0].scrollIntoView(true);window.scrollBy(0, -100);",
1016             $sel_pops );
1017         $d->find_element_ok(
1018             '//div[ @id="list_type_selection_pop_go_btn"]/input[@value="View"]',
1019             'xpath',
1020             'select list sel pop'
1021         )->click();
1022         sleep(3);
1024         my $clustering =
1025           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1026         $d->driver->execute_script(
1027             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1028             $clustering );
1029         sleep(2);
1030         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1031           ->click();
1032         sleep(3);
1033         $d->find_element_ok(
1034             '//select[@id="cluster_pops_select"]/option[text()="'
1035               . $accessions_list_name . '"]',
1036             'xpath',
1037             'select accessions list sel pop'
1038         )->click();
1039         sleep(3);
1040         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1041             'xpath', 'select k-means' )->send_keys('K-means');
1042         sleep(2);
1043         $d->find_element_ok(
1044             '//select[@id="cluster_data_type_select"]/option[text()="GEBV"]',
1045             'xpath', 'select gebv' )->click();
1046         sleep(2);
1047         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1048             'xpath', 'clear k number' )->clear();
1049         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1050             'xpath', 'select k number' )->send_keys(4);
1051         sleep(2);
1052         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1053             'xpath', 'run cluster' )->click();
1054         sleep(3);
1055         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
1056         sleep(80);
1057         $d->find_element_ok(
1058             '//img[@id="k-means-plot-139-'
1059               . $accessions_list_id
1060               . '-traits-1971973596-gebv-k-4"]',
1061             'xpath',
1062             'check k-means plot'
1063         )->click();
1064         sleep(3);
1066         $d->driver->refresh();
1067         sleep(3);
1069         my $sel_pops =
1070           $d->find_element( 'Predict', 'partial_link_text', 'scroll up' );
1071         my $elem = $d->driver->execute_script(
1072             "arguments[0].scrollIntoView(true);window.scrollBy(0, -600);",
1073             $sel_pops );
1074         sleep(2);
1075         $d->find_element_ok( 'list_type_selection_pops_select',
1076             'id', 'select clones list menu' )->click();
1077         sleep(2);
1078         my $dataset = $d->find_element_ok(
1079 '//select[@id="list_type_selection_pops_select"]/option[text()="'
1080               . $accessions_dt_name . '"]',
1081             'xpath',
1082             'select dataset sel pop'
1083         );
1084         $dataset->click();
1085         sleep(2);
1086         $d->find_element_ok(
1087             '//div[ @id="list_type_selection_pop_go_btn"]/input[@value="View"]',
1088             'xpath',
1089             'select list sel pop'
1090         )->click();
1091         sleep(5);
1092         my $clustering =
1093           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1094         $d->driver->execute_script(
1095             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1096             $clustering );
1097         sleep(2);
1098         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1099           ->click();
1100         sleep(2);
1101         $d->find_element_ok(
1102             '//select[@id="cluster_pops_select"]/option[text()="'
1103               . $accessions_dt_name . '"]',
1104             'xpath',
1105             'select accessions dataset sel pop'
1106         )->click();
1107         sleep(2);
1108         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1109             'xpath', 'select k-means' )->send_keys('K-means');
1110         sleep(2);
1111         $d->find_element_ok(
1112 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
1113             'xpath',
1114             'select genotype'
1115         )->click();
1116         sleep(2);
1117         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1118             'xpath', 'clear k number' )->clear();
1119         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1120             'xpath', 'select k number' )->send_keys(4);
1121         sleep(2);
1122         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1123             'xpath', 'run cluster' )->click();
1124         sleep(3);
1125         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
1126         sleep(80);
1127         my $clustering =
1128           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1129         $d->driver->execute_script(
1130             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1131             $clustering );
1132         sleep(5);
1133         $d->find_element_ok(
1134             '//img[@id="k-means-plot-139-'
1135               . $accessions_dt_id
1136               . '-traits-1971973596-genotype-k-4-gp-1"]',
1137             'xpath',
1138             'check k-means plot'
1139         )->click();
1140         sleep(3);
1142         $d->driver->refresh();
1143         sleep(3);
1145         my $sel_pops =
1146           $d->find_element( 'Predict', 'partial_link_text', 'scroll up' );
1147         my $elem = $d->driver->execute_script(
1148             "arguments[0].scrollIntoView(true);window.scrollBy(0, -600);",
1149             $sel_pops );
1150         sleep(5);
1151         $d->find_element_ok( 'list_type_selection_pops_select',
1152             'id', 'select clones list menu' )->click();
1153         sleep(5);
1154         my $dataset = $d->find_element_ok(
1155 '//select[@id="list_type_selection_pops_select"]/option[text()="'
1156               . $accessions_dt_name . '"]',
1157             'xpath',
1158             'select accessions dataset sel pop'
1159         );
1160         $dataset->click();
1161         sleep(5);
1162         $d->find_element_ok(
1163             '//div[ @id="list_type_selection_pop_go_btn"]/input[@value="View"]',
1164             'xpath',
1165             'select list sel pop'
1166         )->click();
1167         sleep(15);
1169         my $clustering =
1170           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1171         $d->driver->execute_script(
1172             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1173             $clustering );
1174         sleep(5);
1175         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1176           ->click();
1177         sleep(3);
1178         $d->find_element_ok(
1179             '//select[@id="cluster_pops_select"]/option[text()="'
1180               . $accessions_dt_name . '"]',
1181             'xpath',
1182             'select accessions dataset sel pop'
1183         )->click();
1184         sleep(3);
1185         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1186             'xpath', 'select k-means' )->send_keys('K-means');
1187         sleep(2);
1188         $d->find_element_ok(
1189             '//select[@id="cluster_data_type_select"]/option[text()="GEBV"]',
1190             'xpath', 'select gebv' )->click();
1191         sleep(2);
1192         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1193             'xpath', 'clear k number' )->clear();
1194         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1195             'xpath', 'select k number' )->send_keys(4);
1196         sleep(2);
1197         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1198             'xpath', 'run cluster' )->click();
1199         sleep(3);
1200         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
1201         sleep(60);
1202         $d->find_element_ok(
1203             '//img[@id="k-means-plot-139-'
1204               . $accessions_dt_id
1205               . '-traits-1971973596-gebv-k-4"]',
1206             'xpath',
1207             'check k-means plot'
1208         )->click();
1209         sleep(3);
1211         $d->driver->refresh();
1212         sleep(3);
1214         my $sel_pops =
1215           $d->find_element( 'Predict', 'partial_link_text', 'scroll up' );
1216         my $elem = $d->driver->execute_script(
1217             "arguments[0].scrollIntoView(true);window.scrollBy(0, -600);",
1218             $sel_pops );
1219         sleep(5);
1220         $d->find_element_ok( 'list_type_selection_pops_select',
1221             'id', 'select clones list menu' )->click();
1222         sleep(5);
1223         my $dataset = $d->find_element_ok(
1224 '//select[@id="list_type_selection_pops_select"]/option[text()="'
1225               . $accessions_dt_name . '"]',
1226             'xpath',
1227             'select dataset sel pop'
1228         );
1229         $dataset->click();
1230         sleep(5);
1231         $d->find_element_ok(
1232             '//div[ @id="list_type_selection_pop_go_btn"]/input[@value="View"]',
1233             'xpath',
1234             'select list sel pop'
1235         )->click();
1236         sleep(15);
1238         my $clustering =
1239           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1240         $d->driver->execute_script(
1241             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1242             $clustering );
1243         sleep(5);
1244         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1245           ->click();
1246         sleep(3);
1247         $d->find_element_ok(
1248             '//select[@id="cluster_pops_select"]/option[text()="'
1249               . $accessions_dt_name . '"]',
1250             'xpath',
1251             'select dataset sel pop'
1252         )->click();
1253         sleep(3);
1254         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1255             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
1256         sleep(2);
1257         $d->find_element_ok(
1258             '//select[@id="cluster_data_type_select"]/option[text()="GEBV"]',
1259             'xpath', 'select gebv' )->click();
1260         sleep(2);
1261         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1262             'xpath', 'run cluster' )->click();
1263         sleep(3);
1264         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
1265         sleep(130);
1266         $d->find_element_ok(
1267             '//img[@id="hierarchical-plot-139-'
1268               . $accessions_dt_id
1269               . '-traits-1971973596-gebv"]',
1270             'xpath',
1271             'check hierarchical plot'
1272         )->click();
1273         sleep(3);
1275         $d->driver->refresh();
1276         sleep(3);
1278         my $sel_pops =
1279           $d->find_element( 'Predict', 'partial_link_text', 'scroll up' );
1280         my $elem = $d->driver->execute_script(
1281             "arguments[0].scrollIntoView(true);window.scrollBy(0, -600);",
1282             $sel_pops );
1283         sleep(5);
1284         $d->find_element_ok( 'list_type_selection_pops_select',
1285             'id', 'select clones list menu' )->click();
1286         sleep(5);
1288         my $dataset = $d->find_element_ok(
1289 '//select[@id="list_type_selection_pops_select"]/option[text()="'
1290               . $accessions_dt_name . '"]',
1291             'xpath',
1292             'select dataset sel pop'
1293         );
1294         $dataset->click();
1295         sleep(5);
1296         $d->find_element_ok(
1297             '//div[ @id="list_type_selection_pop_go_btn"]/input[@value="View"]',
1298             'xpath',
1299             'GO select dataset sel popp'
1300         )->click();
1301         sleep(15);
1302         my $clustering =
1303           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1304         $d->driver->execute_script(
1305             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1306             $clustering );
1307         sleep(5);
1308         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1309           ->click();
1310         sleep(3);
1311         $d->find_element_ok(
1312             '//select[@id="cluster_pops_select"]/option[text()="'
1313               . $accessions_dt_name . '"]',
1314             'xpath',
1315             'select dataset sel pop'
1316         )->click();
1317         sleep(3);
1318         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1319             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
1320         sleep(2);
1321         $d->find_element_ok(
1322 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
1323             'xpath',
1324             'select genotype'
1325         )->click();
1326         sleep(2);
1327         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1328             'xpath', 'run cluster' )->click();
1329         sleep(3);
1330         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
1331         sleep(180);
1333         my $clustering =
1334           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1335         $d->driver->execute_script(
1336             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1337             $clustering );
1338         sleep(5);
1339         $d->find_element_ok(
1340             '//img[@id="hierarchical-plot-139-'
1341               . $accessions_dt_id
1342               . '-traits-1971973596-genotype-gp-1"]',
1343             'xpath',
1344             'check hierarchical plot'
1345         )->click();
1346         sleep(3);
1348         $d->driver->refresh();
1349         sleep(3);
1351         my $clustering =
1352           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1353         my $elem = $d->driver->execute_script(
1354             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1355             $clustering );
1356         sleep(5);
1357         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1358           ->click();
1359         sleep(3);
1360         $d->find_element_ok(
1361 '//select[@id="cluster_pops_select"]/option[text()="Kasese solgs trial"]',
1362             'xpath',
1363             'select trial tr pop'
1364         )->click();
1365         sleep(3);
1366         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1367             'xpath', 'select k-means' )->send_keys('K-means');
1368         sleep(2);
1369         $d->find_element_ok(
1370 '//select[@id="cluster_data_type_select"]/option[text()="Phenotype"]',
1371             'xpath', 'select ghenotype'
1372         )->click();
1373         sleep(2);
1374         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1375             'xpath', 'clear k number' )->clear();
1376         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1377             'xpath', 'select k number' )->send_keys(4);
1378         sleep(2);
1379         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1380             'xpath', 'run cluster' )->click();
1381         sleep(3);
1382         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
1383         sleep(80);
1384         $d->find_element_ok(
1385             '//img[@id="k-means-plot-139-traits-1971973596-phenotype-k-4"]',
1386             'xpath', 'check k-means plot' )->click();
1387         sleep(5);
1389         $d->driver->refresh();
1390         sleep(3);
1392         my $clustering =
1393           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1394         $d->driver->execute_script(
1395             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1396             $clustering );
1397         sleep(5);
1398         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1399           ->click();
1400         sleep(3);
1401         $d->find_element_ok(
1402 '//select[@id="cluster_pops_select"]/option[text()="Kasese solgs trial"]',
1403             'xpath',
1404             'select trial tr pop'
1405         )->click();
1406         sleep(3);
1407         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1408             'xpath', 'select k-means' )->send_keys('K-means');
1409         sleep(2);
1410         $d->find_element_ok(
1411 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
1412             'xpath',
1413             'select genotype'
1414         )->click();
1415         sleep(2);
1416         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1417             'xpath', 'clear k number' )->clear();
1418         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1419             'xpath', 'select k number' )->send_keys(4);
1420         sleep(2);
1421         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1422             'xpath', 'run cluster' )->click();
1423         sleep(3);
1424         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
1425         sleep(80);
1426         $d->find_element_ok(
1427             '//img[@id="k-means-plot-139-traits-1971973596-genotype-k-4-gp-1"]',
1428             'xpath', 'check k-means plot'
1429         )->click();
1430         sleep(5);
1432         $d->driver->refresh();
1433         sleep(3);
1435         my $clustering =
1436           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1437         $d->driver->execute_script(
1438             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1439             $clustering );
1440         sleep(5);
1441         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1442           ->click();
1443         sleep(3);
1444         $d->find_element_ok(
1445 '//select[@id="cluster_pops_select"]/option[text()="Kasese solgs trial"]',
1446             'xpath',
1447             'select trial tr pop'
1448         )->click();
1449         sleep(3);
1450         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1451             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
1452         sleep(2);
1453         $d->find_element_ok(
1454 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
1455             'xpath',
1456             'select genotype'
1457         )->click();
1458         sleep(2);
1459         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1460             'xpath', 'run cluster' )->click();
1461         sleep(3);
1462         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
1463         sleep(40);
1464         $d->find_element_ok(
1465 '//img[@id="hierarchical-plot-139-traits-1971973596-genotype-gp-1"]',
1466             'xpath', 'check hierarchical plot'
1467         )->click();
1468         sleep(5);
1470         $d->driver->refresh();
1471         sleep(3);
1473         my $clustering =
1474           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1475         $d->driver->execute_script(
1476             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1477             $clustering );
1478         sleep(5);
1479         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1480           ->click();
1481         sleep(3);
1482         $d->find_element_ok(
1483 '//select[@id="cluster_pops_select"]/option[text()="Kasese solgs trial"]',
1484             'xpath',
1485             'select trial tr pop'
1486         )->click();
1487         sleep(3);
1488         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1489             'xpath', 'select k-means' )->send_keys('K-means');
1490         sleep(2);
1491         $d->find_element_ok(
1492             '//select[@id="cluster_data_type_select"]/option[text()="GEBV"]',
1493             'xpath', 'select gebv' )->click();
1494         sleep(2);
1495         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1496             'xpath', 'clear k number' )->clear();
1497         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1498             'xpath', 'select k number' )->send_keys(4);
1499         sleep(2);
1500         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1501             'xpath', 'run cluster' )->click();
1502         sleep(3);
1503         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
1504         sleep(60);
1505         $d->find_element_ok(
1506             '//img[@id="k-means-plot-139-traits-1971973596-gebv-k-4"]',
1507             'xpath', 'check k-means plot' )->click();
1509         $d->driver->refresh();
1510         sleep(3);
1512         my $clustering =
1513           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1514         $d->driver->execute_script(
1515             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1516             $clustering );
1517         sleep(5);
1518         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1519           ->click();
1520         sleep(3);
1521         $d->find_element_ok(
1522 '//select[@id="cluster_pops_select"]/option[text()="Kasese solgs trial"]',
1523             'xpath',
1524             'select trial tr pop'
1525         )->click();
1526         sleep(3);
1527         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1528             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
1529         sleep(2);
1530         $d->find_element_ok(
1531             '//select[@id="cluster_data_type_select"]/option[text()="GEBV"]',
1532             'xpath', 'select gebv' )->click();
1533         sleep(2);
1534         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1535             'xpath', 'run cluster' )->click();
1536         sleep(3);
1537         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
1538         sleep(130);
1539         $d->find_element_ok(
1540             '//img[@id="hierarchical-plot-139-traits-1971973596-gebv"]',
1541             'xpath', 'check hierarchical plot' )->click();
1543         $d->driver->refresh();
1544         sleep(3);
1546         my $cor = $d->find_element( 'Genetic correlation',
1547             'partial_link_text', 'scroll up' );
1548         $d->driver->execute_script(
1549             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
1550             $cor );
1551         sleep(5);
1552         $d->find_element_ok( 'si_pops_select', 'id', 'select list sl pop' )
1553           ->click();
1554         sleep(3);
1555         $d->find_element_ok(
1556 '//select[@id="si_pops_select"]/option[text()="Kasese solgs trial"]',
1557             'xpath',
1558             'select trial type tr pop'
1559         )->click();
1560         sleep(3);
1561         $d->find_element_ok( 'DMCP', 'id', 'rel wt 1st' )->send_keys(3);
1562         sleep(5);
1563         $d->find_element_ok( 'FRW', 'id', 'rel wt 2st' )->send_keys(5);
1564         sleep(5);
1565         $d->find_element_ok( 'calculate_si', 'id', 'calc selection index' )
1566           ->click();
1567         sleep(60);
1569         my $clustering =
1570           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1571         $d->driver->execute_script(
1572             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1573             $clustering );
1574         sleep(5);
1575         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1576           ->click();
1577         sleep(3);
1578         $d->find_element_ok(
1579 '//select[@id="cluster_pops_select"]/option[text()="139-DMCP-3-FRW-5"]',
1580             'xpath', 'select sel index pop'
1581         )->click();
1582         sleep(3);
1583         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1584             'xpath', 'select k-means' )->send_keys('K-means');
1585         sleep(2);
1586         $d->find_element_ok(
1587 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
1588             'xpath',
1589             'select genotype'
1590         )->click();
1591         sleep(2);
1592         $d->find_element_ok(
1593             '//*[starts-with(@id, "selection_proportion_input")]',
1594             'xpath', 'fill in sel prop' )->send_keys('15');
1595         sleep(2);
1596         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1597             'xpath', 'clear k number' )->clear();
1598         sleep(1);
1599         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1600             'xpath', 'select k number' )->send_keys(4);
1601         sleep(2);
1602         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1603             'xpath', 'run cluster' )->click();
1604         sleep(3);
1605         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
1606         sleep(60);
1607         $d->find_element_ok(
1608 '//img[@id="k-means-plot-139-139-DMCP-3-FRW-5-genotype-k-4-gp-1-sp-15"]',
1609             'xpath', 'plot'
1610         )->click();
1611         sleep(5);
1613         $d->driver->refresh();
1614         sleep(3);
1616         my $cor = $d->find_element( 'Genetic correlation',
1617             'partial_link_text', 'scroll up' );
1618         $d->driver->execute_script(
1619             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
1620             $cor );
1621         sleep(5);
1622         $d->find_element_ok( 'si_pops_select', 'id', 'select list sl pop' )
1623           ->click();
1624         sleep(3);
1625         $d->find_element_ok(
1626 '//select[@id="si_pops_select"]/option[text()="Kasese solgs trial"]',
1627             'xpath',
1628             'select trial type tr pop'
1629         )->click();
1630         sleep(3);
1631         $d->find_element_ok( 'DMCP', 'id', 'rel wt 1st' )->send_keys(3);
1632         sleep(5);
1633         $d->find_element_ok( 'FRW', 'id', 'rel wt 2st' )->send_keys(5);
1634         sleep(5);
1635         $d->find_element_ok( 'calculate_si', 'id', 'calc selection index' )
1636           ->click();
1637         sleep(130);
1639         my $clustering =
1640           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1641         $d->driver->execute_script(
1642             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1643             $clustering );
1644         sleep(5);
1645         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1646           ->click();
1647         sleep(3);
1648         $d->find_element_ok(
1649 '//select[@id="cluster_pops_select"]/option[text()="139-DMCP-3-FRW-5"]',
1650             'xpath', 'select sel index pop'
1651         )->click();
1652         sleep(3);
1653         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1654             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
1655         sleep(2);
1656         $d->find_element_ok(
1657 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
1658             'xpath',
1659             'select genotype'
1660         )->click();
1661         sleep(2);
1662         $d->find_element_ok(
1663             '//*[starts-with(@id, "selection_proportion_input")]',
1664             'xpath', 'fill in sel prop' )->send_keys('15');
1665         sleep(2);
1666         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1667             'xpath', 'run cluster' )->click();
1668         sleep(3);
1669         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
1670         sleep(40);
1671         $d->find_element_ok(
1672 '//img[@id="hierarchical-plot-139-139-DMCP-3-FRW-5-genotype-gp-1-sp-15"]',
1673             'xpath', 'plot'
1674         )->click();
1675         sleep(5);
1677         $d->driver->refresh();
1678         sleep(3);
1680         my $clustering =
1681           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1682         $d->driver->execute_script(
1683             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1684             $clustering );
1685         sleep(5);
1686         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1687           ->click();
1688         sleep(3);
1689         $d->find_element_ok(
1690 '//select[@id="cluster_pops_select"]/option[text()="trial2 NaCRRI"]',
1691             'xpath',
1692             'select trial sel pop'
1693         )->click();
1694         sleep(3);
1695         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1696             'xpath', 'select k-means' )->send_keys('K-means');
1697         sleep(2);
1698         $d->find_element_ok(
1699 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
1700             'xpath',
1701             'select genotype'
1702         )->click();
1703         sleep(2);
1704         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1705             'xpath', 'clear k number' )->clear();
1706         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1707             'xpath', 'select k number' )->send_keys(4);
1708         sleep(2);
1709         $d->find_element_ok(
1710             '//*[starts-with(@id, "run_cluster")]',
1711             'xpath',
1712             'run trial2 NaCRRI  geno cluster'
1713         )->click();
1714         sleep(3);
1715         $d->find_element_ok( 'no_queue', 'id',
1716             'no job queueing -- trial2 NaCRRI  geno cluster' )->click();
1717         sleep(200);
1718         $d->find_element_ok(
1719 '//img[@id="k-means-plot-139-141-traits-1971973596-genotype-k-4-gp-1"]',
1720             'xpath', 'check trial2 NaCRRI  geno k-means plot'
1721         )->click();
1722         sleep(5);
1724         $d->driver->refresh();
1725         sleep(3);
1727         my $clustering =
1728           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1729         $d->driver->execute_script(
1730             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1731             $clustering );
1732         sleep(5);
1733         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1734           ->click();
1735         sleep(3);
1736         $d->find_element_ok(
1737 '//select[@id="cluster_pops_select"]/option[text()="trial2 NaCRRI"]',
1738             'xpath',
1739             'select trial sel pop'
1740         )->click();
1741         sleep(3);
1742         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1743             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
1744         sleep(2);
1745         $d->find_element_ok(
1746 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
1747             'xpath',
1748             'select genotype'
1749         )->click();
1750         sleep(2);
1751         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1752             'xpath', 'run cluster' )->click();
1753         sleep(3);
1754         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
1755         sleep(130);
1756         $d->find_element_ok(
1757 '//img[@id="hierarchical-plot-139-141-traits-1971973596-genotype-gp-1"]',
1758             'xpath', 'check hierarchical plot'
1759         )->click();
1760         sleep(5);
1762         $d->driver->refresh();
1763         sleep(3);
1765         my $clustering =
1766           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1767         $d->driver->execute_script(
1768             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
1769             $clustering );
1770         sleep(5);
1771         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1772           ->click();
1773         sleep(3);
1774         $d->find_element_ok(
1775 '//select[@id="cluster_pops_select"]/option[text()="trial2 NaCRRI"]',
1776             'xpath',
1777             'select trial sel pop'
1778         )->click();
1779         sleep(3);
1780         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1781             'xpath', 'select k-means' )->send_keys('K-means');
1782         sleep(2);
1783         $d->find_element_ok(
1784             '//select[@id="cluster_data_type_select"]/option[text()="GEBV"]',
1785             'xpath', 'select gebv' )->click();
1786         sleep(2);
1787         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1788             'xpath', 'clear k number' )->clear();
1789         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1790             'xpath', 'select k number' )->send_keys(4);
1791         sleep(2);
1792         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1793             'xpath', 'run cluster' )->click();
1794         sleep(3);
1795         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
1796         sleep(80);
1797         $d->find_element_ok(
1798             '//img[@id="k-means-plot-139-141-traits-1971973596-gebv-k-4"]',
1799             'xpath', 'check k-means plot' )->click();
1800         sleep(3);
1802         $d->driver->refresh();
1803         sleep(3);
1805         my $clustering =
1806           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1807         $d->driver->execute_script(
1808             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
1809             $clustering );
1810         sleep(5);
1811         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1812           ->click();
1813         sleep(3);
1814         $d->find_element_ok(
1815 '//select[@id="cluster_pops_select"]/option[text()="trial2 NaCRRI"]',
1816             'xpath',
1817             'select trial sel pop'
1818         )->click();
1819         sleep(3);
1820         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1821             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
1822         sleep(2);
1823         $d->find_element_ok(
1824 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="GEBV"]',
1825             'xpath',
1826             'select gebv'
1827         )->click();
1828         sleep(2);
1829         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1830             'xpath', 'run cluster' )->click();
1831         sleep(3);
1832         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
1833         sleep(40);
1834         $d->find_element_ok(
1835             '//img[@id="hierarchical-plot-139-141-traits-1971973596-gebv"]',
1836             'xpath', 'check hierarchical plot' )->click();
1837         sleep(3);
1839         $d->driver->refresh();
1840         sleep(3);
1842         `rm -r $cluster_dir`;
1843         sleep(3);
1844         `rm -r $log_dir`;
1845         sleep(5);
1847 # # $d->get_ok('solgs/traits/all/population/139/traits/1971973596/gp/1', 'models page');
1848 # # sleep(15);
1850         my $clustering =
1851           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1852         $d->driver->execute_script(
1853             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1854             $clustering );
1855         sleep(5);
1856         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1857           ->click();
1858         sleep(3);
1859         $d->find_element_ok(
1860 '//select[@id="cluster_pops_select"]/option[text()="trial2 NaCRRI"]',
1861             'xpath',
1862             'select trial sel pop'
1863         )->click();
1864         sleep(3);
1865         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1866             'xpath', 'select k-means' )->send_keys('K-means');
1867         sleep(2);
1868         $d->find_element_ok(
1869 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
1870             'xpath',
1871             'select genotype'
1872         )->click();
1873         sleep(2);
1874         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1875             'xpath', 'clear k number' )->clear();
1876         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1877             'xpath', 'select k number' )->send_keys(4);
1878         sleep(2);
1879         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1880             'xpath', 'run cluster' )->click();
1881         sleep(3);
1882         $d->find_element_ok( 'queue_job', 'id',
1883             'queueing trial2 NaCRRI  geno km clustering' )->click();
1884         sleep(3);
1885         $d->find_element_ok( 'analysis_name', 'id',
1886             'analysis name -Nacrri sel pop geno clustering' )
1887           ->send_keys('Nacrri sel pop geno clustering');
1888         sleep(2);
1889         $d->find_element_ok( 'user_email', 'id', 'user email' )
1890           ->send_keys('email@email.com');
1891         sleep(2);
1892         $d->find_element_ok( 'submit_job', 'id', 'submit' )->click();
1893         sleep(200);
1894         $d->find_element_ok( 'Go back', 'partial_link_text', 'go back' )
1895           ->click();
1896         sleep(3);
1898         $d->driver->refresh();
1899         sleep(3);
1901         my $clustering =
1902           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1903         $d->driver->execute_script(
1904             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
1905             $clustering );
1906         sleep(5);
1907         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1908           ->click();
1909         sleep(3);
1910         $d->find_element_ok(
1911 '//select[@id="cluster_pops_select"]/option[text()="trial2 NaCRRI"]',
1912             'xpath',
1913             'select trial sel pop'
1914         )->click();
1915         sleep(3);
1916         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1917             'xpath', 'select k-means' )->send_keys('K-means');
1918         sleep(2);
1919         $d->find_element_ok(
1920 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
1921             'xpath',
1922             'select genotype'
1923         )->click();
1924         sleep(2);
1925         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1926             'xpath', 'clear k number' )->clear();
1927         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1928             'xpath', 'select k number' )->send_keys(4);
1929         sleep(2);
1930         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1931             'xpath', 'run cluster' )->click();
1932         sleep(20);
1933         $d->find_element_ok(
1934 '//img[@id="k-means-plot-139-141-traits-1971973596-genotype-k-4-gp-1"]',
1935             'xpath', 'check k-means plot'
1936         )->click();
1937         sleep(3);
1939         $d->driver->refresh();
1940         sleep(3);
1942         my $clustering =
1943           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1944         $d->driver->execute_script(
1945             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
1946             $clustering );
1947         sleep(5);
1948         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1949           ->click();
1950         sleep(3);
1951         $d->find_element_ok(
1952 '//select[@id="cluster_pops_select"]/option[text()="trial2 NaCRRI"]',
1953             'xpath',
1954             'select trial sel pop'
1955         )->click();
1956         sleep(3);
1957         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
1958             'xpath', 'select k-means' )->send_keys('K-means');
1959         sleep(2);
1960         $d->find_element_ok(
1961             '//select[@id="cluster_data_type_select"]/option[text()="GEBV"]',
1962             'xpath', 'select gebv' )->click();
1963         sleep(2);
1964         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1965             'xpath', 'clear k number' )->clear();
1966         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
1967             'xpath', 'select k number' )->send_keys(4);
1968         sleep(2);
1969         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
1970             'xpath', 'run cluster' )->click();
1971         sleep(3);
1972         $d->find_element_ok( 'queue_job', 'id',
1973             'queueing trial2 NaCRRI  gebv cluster' )->click();
1974         sleep(3);
1975         $d->find_element_ok( 'analysis_name', 'id',
1976             'analysis name -Nacrri sel pop gebv clustering' )
1977           ->send_keys('Nacrri sel pop gebv clustering');
1978         sleep(2);
1979         $d->find_element_ok( 'user_email', 'id', 'user email' )
1980           ->send_keys('email@email.com');
1981         sleep(2);
1982         $d->find_element_ok( 'submit_job', 'id', 'submit' )->click();
1983         sleep(200);
1984         $d->find_element_ok( 'Go back', 'partial_link_text', 'go back' )
1985           ->click();
1986         sleep(3);
1988         $d->driver->refresh();
1989         sleep(3);
1991         my $clustering =
1992           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
1993         $d->driver->execute_script(
1994             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
1995             $clustering );
1996         sleep(5);
1997         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
1998           ->click();
1999         sleep(3);
2000         $d->find_element_ok(
2001 '//select[@id="cluster_pops_select"]/option[text()="trial2 NaCRRI"]',
2002             'xpath',
2003             'select trial sel pop'
2004         )->click();
2005         sleep(3);
2006         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
2007             'xpath', 'select k-means' )->send_keys('K-means');
2008         sleep(2);
2009         $d->find_element_ok(
2010             '//select[@id="cluster_data_type_select"]/option[text()="GEBV"]',
2011             'xpath', 'select gebv' )->click();
2012         sleep(2);
2013         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2014             'xpath', 'clear k number' )->clear();
2015         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2016             'xpath', 'select k number' )->send_keys(4);
2017         sleep(2);
2018         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
2019             'xpath', 'run cluster' )->click();
2020         sleep(10);
2021         $d->find_element_ok(
2022             '//img[@id="k-means-plot-139-141-traits-1971973596-gebv-k-4"]',
2023             'xpath', 'check k-means plot' )->click();
2024         sleep(3);
2026         $d->driver->refresh();
2027         sleep(3);
2029         my $cor = $d->find_element( 'Genetic correlation',
2030             'partial_link_text', 'scroll up' );
2031         $d->driver->execute_script(
2032             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
2033             $cor );
2034         sleep(5);
2035         $d->find_element_ok( 'si_pops_select', 'id', 'select list sl pop' )
2036           ->click();
2037         sleep(3);
2038         $d->find_element_ok(
2039 '//select[@id="si_pops_select"]/option[text()="Kasese solgs trial"]',
2040             'xpath',
2041             'select trial type tr pop'
2042         )->click();
2043         sleep(3);
2044         $d->find_element_ok( 'DMCP', 'id', 'rel wt 1st' )->send_keys(3);
2045         sleep(5);
2046         $d->find_element_ok( 'FRW', 'id', 'rel wt 2st' )->send_keys(5);
2047         sleep(5);
2048         $d->find_element_ok( 'calculate_si', 'id', 'calc selection index' )
2049           ->click();
2050         sleep(60);
2052         my $clustering =
2053           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
2054         $d->driver->execute_script(
2055             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
2056             $clustering );
2057         sleep(5);
2058         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
2059           ->click();
2060         sleep(3);
2061         $d->find_element_ok(
2062 '//select[@id="cluster_pops_select"]/option[text()="139-DMCP-3-FRW-5"]',
2063             'xpath', 'select sel index pop'
2064         )->click();
2065         sleep(3);
2066         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
2067             'xpath', 'select k-means' )->send_keys('K-means');
2068         sleep(2);
2069         $d->find_element_ok(
2070 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
2071             'xpath',
2072             'select genotype'
2073         )->click();
2074         sleep(2);
2075         $d->find_element_ok(
2076             '//*[starts-with(@id, "selection_proportion_input")]',
2077             'xpath', 'fill in sel prop' )->send_keys('15');
2078         sleep(2);
2079         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2080             'xpath', 'clear k number' )->clear();
2081         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2082             'xpath', 'select k number' )->send_keys(4);
2083         sleep(2);
2084         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
2085             'xpath', 'run cluster' )->click();
2086         sleep(3);
2087         $d->find_element_ok( 'queue_job', 'id', 'no job queueing' )->click();
2088         sleep(3);
2089         $d->find_element_ok( 'analysis_name', 'id',
2090             'analysis name -Nacrri sel pop sindex clustering' )
2091           ->send_keys('Nacrri sel pop sindex clustering');
2092         sleep(2);
2093         $d->find_element_ok( 'user_email', 'id', 'user email' )
2094           ->send_keys('email@email.com');
2095         sleep(2);
2096         $d->find_element_ok( 'submit_job', 'id', 'submit' )->click();
2097         sleep(140);
2098         $d->find_element_ok( 'Go back', 'partial_link_text', 'go back' )
2099           ->click();
2100         sleep(3);
2102         my $cor = $d->find_element( 'Genetic correlation',
2103             'partial_link_text', 'scroll up' );
2104         $d->driver->execute_script(
2105             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
2106             $cor );
2107         sleep(5);
2108         $d->find_element_ok( 'si_pops_select', 'id', 'select list sl pop' )
2109           ->click();
2110         sleep(3);
2111         $d->find_element_ok(
2112 '//select[@id="si_pops_select"]/option[text()="Kasese solgs trial"]',
2113             'xpath',
2114             'select trial type tr pop'
2115         )->click();
2116         sleep(3);
2117         $d->find_element_ok( 'DMCP', 'id', 'rel wt 1st' )->send_keys(3);
2118         sleep(5);
2119         $d->find_element_ok( 'FRW', 'id', 'rel wt 2st' )->send_keys(5);
2120         sleep(5);
2121         $d->find_element_ok( 'calculate_si', 'id', 'calc selection index' )
2122           ->click();
2123         sleep(60);
2124         #
2125         my $clustering =
2126           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
2127         $d->driver->execute_script(
2128             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
2129             $clustering );
2130         sleep(5);
2131         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
2132           ->click();
2133         sleep(3);
2134         $d->find_element_ok(
2135 '//select[@id="cluster_pops_select"]/option[text()="139-DMCP-3-FRW-5"]',
2136             'xpath', 'select sel index pop'
2137         )->click();
2138         sleep(3);
2139         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
2140             'xpath', 'select k-means' )->send_keys('K-means');
2141         sleep(2);
2142         $d->find_element_ok(
2143 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
2144             'xpath',
2145             'select genotype'
2146         )->click();
2147         sleep(2);
2148         $d->find_element_ok(
2149             '//*[starts-with(@id, "selection_proportion_input")]',
2150             'xpath', 'fill in sel prop' )->send_keys('15');
2151         sleep(2);
2152         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2153             'xpath', 'clear k number' )->clear();
2154         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2155             'xpath', 'select k number' )->send_keys(4);
2156         sleep(2);
2157         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
2158             'xpath', 'run cluster' )->click();
2159         sleep(140);
2160         $d->find_element_ok(
2161 '//img[@id="k-means-plot-139-139-DMCP-3-FRW-5-genotype-k-4-gp-1-sp-15"]',
2162             'xpath', 'plot'
2163         )->click();
2164         sleep(5);
2166         $d->driver->refresh();
2167         sleep(3);
2169 #########################
2170         `rm -r $cluster_dir`;
2171         sleep(3);
2172         `rm -r $log_dir`;
2173         sleep(5);
2174 ########################################
2176         my $clustering =
2177           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
2178         $d->driver->execute_script(
2179             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
2180             $clustering );
2181         sleep(5);
2182         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
2183           ->click();
2184         sleep(3);
2185         $d->find_element_ok(
2186 '//select[@id="cluster_pops_select"]/option[text()="trial2 NaCRRI"]',
2187             'xpath',
2188             'select trial sel pop'
2189         )->click();
2190         sleep(3);
2191         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
2192             'xpath', 'select k-means' )->send_keys('K-means');
2193         sleep(2);
2194         $d->find_element_ok(
2195 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
2196             'xpath',
2197             'select genotype'
2198         )->click();
2199         sleep(2);
2200         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2201             'xpath', 'clear k number' )->clear();
2202         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2203             'xpath', 'select k number' )->send_keys(4);
2204         sleep(2);
2205         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
2206             'xpath', 'run cluster' )->click();
2207         sleep(3);
2208         $d->find_element_ok( 'no_queue', 'id',
2209             'wait to finish clustering trial2 NaCRRI genotype' )->click();
2210         sleep(200);
2211         $d->find_element_ok(
2212 '//img[@id="k-means-plot-139-141-traits-1971973596-genotype-k-4-gp-1"]',
2213             'xpath', 'check k-means plot'
2214         )->click();
2215         sleep(5);
2217         $d->driver->refresh();
2218         sleep(3);
2220 # #    #  #######    #
2221 # #    #  $d->get_ok('/solgs/trait/70666/population/139/gp/1', 'open model page');
2222 # #    #  sleep(5);
2223 # #    #
2225         my $clustering =
2226           $d->find_element( 'Models summary', 'partial_link_text',
2227             'scroll up' );
2228         $d->driver->execute_script(
2229             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
2230             $clustering );
2231         sleep(5);
2232         $d->find_element_ok(
2233             '//table[@id="model_summary"]//*[contains(text(), "FRW")]',
2234             'xpath', 'click training pop' )->click();
2235         sleep(5);
2236         ######
2238         my $clustering =
2239           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
2240         $d->driver->execute_script(
2241             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
2242             $clustering );
2243         sleep(5);
2244         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
2245             'xpath', 'select k-means' )->send_keys('K-means');
2246         sleep(2);
2247         $d->find_element_ok(
2248 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
2249             'xpath',
2250             'select genotype'
2251         )->click();
2252         sleep(2);
2253         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2254             'xpath', 'clear k number' )->clear();
2255         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2256             'xpath', 'select k number' )->send_keys(4);
2257         sleep(2);
2258         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
2259             'xpath', 'run cluster' )->click();
2260         sleep(3);
2261         $d->find_element_ok( 'no_queue', 'id',
2262             'wait to finish clustering in single trial model page' )->click();
2263         sleep(200);
2264         $d->find_element_ok(
2265             '//img[@id="k-means-plot-139-70666-genotype-k-4-gp-1"]',
2266             'xpath', 'check k-means plot' )->click();
2267         sleep(5);
2269         $d->driver->refresh();
2270         sleep(3);
2272         my $clustering =
2273           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
2274         $d->driver->execute_script(
2275             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
2276             $clustering );
2277         sleep(5);
2278         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
2279             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
2280         sleep(2);
2281         $d->find_element_ok(
2282 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
2283             'xpath',
2284             'select genotype'
2285         )->click();
2286         sleep(2);
2287         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
2288             'xpath', 'run cluster' )->click();
2289         sleep(3);
2290         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
2291         sleep(130);
2292         $d->find_element_ok(
2293             '//img[@id="hierarchical-plot-139-70666-genotype-gp-1"]',
2294             'xpath', 'check hierarchical plot' )->click();
2295         sleep(5);
2297 # #    #  #$d->get_ok('/solgs/model/combined/populations/2804608595/trait/70741/gp/1', 'open combined trials model page');
2298 # #    # # sleep(2);
2299 # #    #
2301         $d->get_ok( '/solgs', 'solgs home page' );
2302         sleep(2);
2303         $d->find_element_ok( 'trial_search_box', 'id',
2304             'population search form' )->send_keys('Kasese solgs trial');
2305         sleep(2);
2306         $d->find_element_ok( 'search_trial', 'id',
2307             'search for training pop' )->click();
2308         sleep(1);
2309         $d->find_element_ok( 'trial_search_box', 'id',
2310             'population search form' )->clear();
2311         sleep(2);
2312         $d->find_element_ok( 'trial_search_box', 'id',
2313             'population search form' )->send_keys('trial2 nacrri');
2314         sleep(5);
2315         $d->find_element_ok( 'search_trial', 'id',
2316             'search for training pop' )->click();
2317         sleep(1);
2319         $d->find_element_ok(
2320             '//table[@id="searched_trials_table"]//input[@value="139"]',
2321             'xpath', 'select trial kasese' )->click();
2322         sleep(2);
2323         $d->find_element_ok(
2324             '//table[@id="searched_trials_table"]//input[@value="141"]',
2325             'xpath', 'select trial nacrri' )->click();
2326         sleep(2);
2327         $d->find_element_ok( 'select_trials_btn', 'id', 'done selecting' )
2328           ->click();
2329         sleep(2);
2330         $d->find_element_ok( 'combine_trait_trials', 'id', 'combine trials' )
2331           ->click();
2332         sleep(3);
2333         $d->find_element_ok( 'queue_job', 'id', 'submit job tr pop' )->click();
2334         sleep(2);
2335         $d->find_element_ok( 'analysis_name', 'id', 'job queueing' )
2336           ->send_keys('combined trials');
2337         sleep(2);
2338         $d->find_element_ok( 'user_email', 'id', 'user email' )
2339           ->send_keys('email@email.com');
2340         sleep(2);
2341         $d->find_element_ok( 'submit_job', 'id', 'submit' )->click();
2342         sleep(200);
2343         $d->find_element_ok( 'Go back', 'partial_link_text', 'go back' )
2344           ->click();
2345         sleep(10);
2347 #         ####################
2348 # #  #$d->get('/solgs/populations/combined/2804608595/gp/1', 'combo trials tr pop page');
2349 # #    #  #sleep(5);
2350 # #    #
2351 #         ##################
2352         $d->get_ok( '/solgs', 'solgs homepage' );
2353         sleep(2);
2355         $d->find_element_ok( 'trial_search_box', 'id',
2356             'population search form' )->send_keys('Kasese solgs trial');
2357         sleep(2);
2358         $d->find_element_ok( 'search_trial', 'id',
2359             'search for training pop' )->click();
2360         sleep(1);
2361         $d->find_element_ok( 'trial_search_box', 'id',
2362             'population search form' )->clear();
2363         sleep(2);
2364         $d->find_element_ok( 'trial_search_box', 'id',
2365             'population search form' )->send_keys('trial2 nacrri');
2366         sleep(5);
2367         $d->find_element_ok( 'search_trial', 'id',
2368             'search for training pop' )->click();
2369         sleep(3);
2371         $d->find_element_ok(
2372             '//table[@id="searched_trials_table"]//input[@value="139"]',
2373             'xpath', 'select trial kasese' )->click();
2374         sleep(2);
2375         $d->find_element_ok(
2376             '//table[@id="searched_trials_table"]//input[@value="141"]',
2377             'xpath', 'select trial nacrri' )->click();
2378         sleep(2);
2379         $d->find_element_ok( 'select_trials_btn', 'id', 'done selecting' )
2380           ->click();
2381         sleep(2);
2382         $d->find_element_ok( 'combine_trait_trials', 'id', 'combine trials' )
2383           ->click();
2384         sleep(15);
2386         $d->find_element_ok(
2387             '//table[@id="population_traits_list"]/tbody/tr[1]/td/input',
2388             'xpath', 'select 1st trait' )->click();
2389         sleep(1);
2390         $d->find_element_ok(
2391             '//table[@id="population_traits_list"]/tbody/tr[2]/td/input',
2392             'xpath', 'select 2nd trait' )->click();
2393         sleep(1);
2394         $d->find_element_ok( 'runGS', 'id',
2395             'run combined trials build multi models' )->click();
2396         sleep(10);
2397         $d->find_element_ok( 'queue_job', 'id', 'combined trials job queueing' )
2398           ->click();
2399         sleep(2);
2400         $d->find_element_ok( 'analysis_name', 'id',
2401             'combined trials multi models job name' )
2402           ->send_keys('Test DMCP-FRW modeling combo trials');
2403         sleep(2);
2404         $d->find_element_ok( 'user_email', 'id', 'user email' )
2405           ->send_keys('email@email.com');
2406         sleep(2);
2407         $d->find_element_ok( 'submit_job', 'id', 'submit' )->click();
2408         sleep(200);
2409         $d->find_element_ok( 'Go back', 'partial_link_text', 'go back' )
2410           ->click();
2411         sleep(15);
2413 # # ###########################
2414 # # # $d->get('/solgs/populations/combined/2804608595/gp/1', 'combo trials tr pop page');
2415 # #  # sleep(5);
2416 # #   ############################
2418         $d->find_element_ok(
2419             '//table[@id="population_traits_list"]/tbody/tr[1]/td/input',
2420             'xpath', 'select 1st trait' )->click();
2421         sleep(1);
2422         $d->find_element_ok(
2423             '//table[@id="population_traits_list"]/tbody/tr[2]/td/input',
2424             'xpath', 'select 2nd trait' )->click();
2425         sleep(1);
2426         $d->find_element_ok( 'runGS', 'id',
2427             ' go to combined trials multi models page' )->click();
2428         sleep(10);
2430         $d->find_element_ok( 'trial_search_box', 'id',
2431             'combo trials models sel population search form' )
2432           ->send_keys('trial2 NaCRRI');
2433         sleep(5);
2434         $d->find_element_ok( 'search_selection_pop', 'id',
2435             'search for selection pop' )->click();
2436         sleep(20);
2437         $d->find_element_ok(
2438 '//table[@id="selection_pops_table"]//*[contains(text(), "Predict")]',
2439             'xpath',
2440             'click training pop'
2441         )->click();
2442         sleep(5);
2443         $d->find_element_ok( 'queue_job', 'id',
2444             'trial sel pop prediction job queueing' )->click();
2445         sleep(2);
2446         $d->find_element_ok( 'analysis_name', 'id',
2447             'sel pop prediction analysis name' )
2448           ->send_keys('combo DMCP-FRW selection pred nacrri');
2449         sleep(2);
2450         $d->find_element_ok( 'user_email', 'id', 'user email' )
2451           ->send_keys('email@email.com');
2452         sleep(2);
2453         $d->find_element_ok( 'submit_job', 'id', 'submit' )->click();
2454         sleep(250);
2455         $d->find_element_ok( 'Go back', 'partial_link_text',
2456             'go back to combo trials multi models pg' )->click();
2457         sleep(15);
2459         $d->find_element_ok(
2460 '//select[@id="list_type_selection_pops_select"]/option[text()="'
2461               . $accessions_list_name . '"]',
2462             'xpath',
2463             'list sl pop'
2464         )->click();
2465         sleep(10);
2466         $d->find_element_ok( '//input[@value="View"]', 'xpath',
2467             'select list sel pop' )->click();
2468         sleep(5);
2469         $d->find_element_ok(
2470 '//table[@id="list_type_selection_pops_table"]//*[contains(text(), "Predict")]',
2471             'xpath',
2472             'click list sel pred'
2473         )->click();
2474         sleep(20);
2475         $d->find_element_ok( 'queue_job', 'id',
2476             'list type sel pop prediction job queueing' )->click();
2477         sleep(2);
2478         $d->find_element_ok( 'analysis_name', 'id',
2479             'list type  sel pop prediction analysis name' )
2480           ->send_keys('combo clones list dmc-frw sel pred');
2481         sleep(2);
2482         $d->find_element_ok( 'user_email', 'id', 'user email' )
2483           ->send_keys('email@email.com');
2484         sleep(2);
2485         $d->find_element_ok( 'submit_job', 'id', 'submit' )->click();
2486         sleep(250);
2487         $d->find_element_ok( 'Go back', 'partial_link_text', 'go back' )
2488           ->click();
2489         sleep(5);
2491         $d->find_element_ok(
2492 '//select[@id="list_type_selection_pops_select"]/option[text()="'
2493               . $accessions_dt_name . '"]',
2494             'xpath',
2495             'select list sl pop'
2496         )->click();
2497         sleep(5);
2498         $d->find_element_ok( '//input[@value="View"]', 'xpath',
2499             'select dataset sel pop' )->click();
2500         sleep(5);
2501         $d->find_element_ok(
2502 '//table[@id="list_type_selection_pops_table"]//*[contains(text(), "Predict")]',
2503             'xpath',
2504             'click accessions dataset sel pred'
2505         )->click();
2506         sleep(5);
2507         $d->find_element_ok( 'queue_job', 'id',
2508             'dataset sel pop prediction job queueing' )->click();
2509         sleep(2);
2510         $d->find_element_ok( 'analysis_name', 'id',
2511             'dataset sel pop prediction analysis name' )
2512           ->send_keys('combo dataset clones sel pred');
2513         sleep(2);
2514         $d->find_element_ok( 'user_email', 'id', 'user email' )
2515           ->send_keys('email@email.com');
2516         sleep(2);
2517         $d->find_element_ok( 'submit_job', 'id', 'submit' )->click();
2518         sleep(250);
2519         $d->find_element_ok( 'Go back', 'partial_link_text', 'go back' )
2520           ->click();
2521         sleep(3);
2523         my $clustering =
2524           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
2525         $d->driver->execute_script(
2526             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
2527             $clustering );
2528         sleep(5);
2529         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
2530           ->click();
2531         sleep(3);
2532         $d->find_element_ok(
2533 '//select[@id="cluster_pops_select"]/option[text()="Training population 2804608595"]',
2534             'xpath',
2535             'select list sel pop'
2536         )->click();
2537         sleep(5);
2538         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
2539             'xpath', 'select k-means' )->send_keys('K-means');
2540         sleep(2);
2541         $d->find_element_ok(
2542 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Phenotype"]',
2543             'xpath',
2544             'select phenotype'
2545         )->click();
2546         sleep(2);
2547         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2548             'xpath', 'select k number' )->send_keys(4);
2549         sleep(2);
2550         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
2551             'xpath', 'run cluster' )->click();
2552         sleep(3);
2553         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
2554         sleep(200);
2555         $d->find_element_ok(
2556 '//img[@id="k-means-plot-2804608595-traits-1971973596-phenotype-k-4"]',
2557             'xpath', 'check k-means plot'
2558         )->click();
2559         sleep(5);
2561         $d->driver->refresh();
2562         sleep(3);
2564         my $clustering =
2565           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
2566         $d->driver->execute_script(
2567             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
2568             $clustering );
2569         sleep(5);
2570         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
2571           ->click();
2572         sleep(3);
2573         $d->find_element_ok(
2574 '//select[@id="cluster_pops_select"]/option[text()="Training population 2804608595"]',
2575             'xpath',
2576             'select list sel pop'
2577         )->click();
2578         sleep(5);
2579         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
2580             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
2581         sleep(2);
2582         $d->find_element_ok(
2583 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Phenotype"]',
2584             'xpath',
2585             'select phenotype'
2586         )->click();
2587         sleep(2);
2588         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
2589             'xpath', 'run cluster' )->click();
2590         sleep(3);
2591         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
2592         sleep(130);
2593         $d->find_element_ok(
2594 '//img[@id="hierarchical-plot-2804608595-traits-1971973596-phenotype"]',
2595             'xpath', 'check hierarchical plot'
2596         )->click();
2597         sleep(5);
2599         $d->driver->refresh();
2600         sleep(3);
2602         my $clustering =
2603           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
2604         $d->driver->execute_script(
2605             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
2606             $clustering );
2607         sleep(5);
2608         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
2609           ->click();
2610         sleep(3);
2611         $d->find_element_ok(
2612 '//select[@id="cluster_pops_select"]/option[text()="Training population 2804608595"]',
2613             'xpath',
2614             'select list sel pop'
2615         )->click();
2616         sleep(5);
2617         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
2618             'xpath', 'select k-means' )->send_keys('K-means');
2619         sleep(2);
2620         $d->find_element_ok(
2621             '//select[@id="cluster_data_type_select"]/option[text()="GEBV"]',
2622             'xpath', 'select phenotype' )->click();
2623         sleep(2);
2624         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2625             'xpath', 'select k number' )->send_keys(4);
2626         sleep(2);
2627         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
2628             'xpath', 'run cluster' )->click();
2629         sleep(3);
2630         $d->find_element_ok( 'no_queue', 'id', 'no job queueing -- GEBV' )
2631           ->click();
2632         sleep(200);
2633         $d->find_element_ok(
2634             '//img[@id="k-means-plot-2804608595-traits-1971973596-gebv-k-4"]',
2635             'xpath', 'check k-means plot' )->click();
2636         sleep(5);
2638         $d->driver->refresh();
2639         sleep(3);
2641         my $clustering =
2642           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
2643         $d->driver->execute_script(
2644             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
2645             $clustering );
2646         sleep(5);
2647         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
2648           ->click();
2649         sleep(3);
2650         $d->find_element_ok(
2651 '//select[@id="cluster_pops_select"]/option[text()="Training population 2804608595"]',
2652             'xpath',
2653             'select list sel pop'
2654         )->click();
2655         sleep(5);
2656         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
2657             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
2658         sleep(2);
2659         $d->find_element_ok(
2660             '//select[@id="cluster_data_type_select"]/option[text()="GEBV"]',
2661             'xpath', 'select phenotype' )->click();
2662         sleep(2);
2663         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
2664             'xpath', 'run cluster' )->click();
2665         sleep(3);
2666         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
2667         sleep(130);
2668         $d->find_element_ok(
2669             '//img[@id="hierarchical-plot-2804608595-traits-1971973596-gebv"]',
2670             'xpath', 'check hierarchical plot'
2671         )->click();
2672         sleep(5);
2674         $d->driver->refresh();
2675         sleep(3);
2677         my $clustering =
2678           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
2679         $d->driver->execute_script(
2680             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
2681             $clustering );
2682         sleep(5);
2683         $d->find_element_ok( 'cluster_pops_select', 'id', 'click cluster pops' )
2684           ->click();
2685         sleep(3);
2686         $d->find_element_ok(
2687 '//select[@id="cluster_pops_select"]/option[text()="Training population 2804608595"]',
2688             'xpath',
2689             'select tr pop'
2690         )->click();
2691         sleep(5);
2692         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
2693             'xpath', 'select k-means' )->send_keys('K-means');
2694         sleep(2);
2695         $d->find_element_ok(
2696 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
2697             'xpath',
2698             'select genotype'
2699         )->click();
2700         sleep(2);
2701         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2702             'xpath', 'clear k number' )->clear();
2703         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2704             'xpath', 'select k number' )->send_keys(4);
2705         sleep(2);
2706         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
2707             'xpath', 'run cluster' )->click();
2708         sleep(3);
2709         $d->find_element_ok( 'no_queue', 'id', 'no job queueing-- Genotype' )
2710           ->click();
2711         sleep(200);
2712         $d->find_element_ok(
2713 '//img[@id="k-means-plot-2804608595-traits-1971973596-genotype-k-4-gp-1"]',
2714             'xpath', 'plot'
2715         )->click();
2716         sleep(5);
2718         $d->driver->refresh();
2719         sleep(3);
2721         my $clustering =
2722           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
2723         $d->driver->execute_script(
2724             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
2725             $clustering );
2726         sleep(5);
2727         $d->find_element_ok( 'cluster_pops_select', 'id', 'click cluster pops' )
2728           ->click();
2729         sleep(3);
2730         $d->find_element_ok(
2731 '//select[@id="cluster_pops_select"]/option[text()="Training population 2804608595"]',
2732             'xpath',
2733             'select tr pop'
2734         )->click();
2735         sleep(5);
2736         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
2737             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
2738         sleep(2);
2739         $d->find_element_ok(
2740 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
2741             'xpath',
2742             'select genotype'
2743         )->click();
2744         sleep(2);
2745         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
2746             'xpath', 'run cluster' )->click();
2747         sleep(3);
2748         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
2749         sleep(130);
2750         $d->find_element_ok(
2751 '//img[@id="hierarchical-plot-2804608595-traits-1971973596-genotype-gp-1"]',
2752             'xpath', 'plot'
2753         )->click();
2754         sleep(5);
2756         $d->driver->refresh();
2757         sleep(3);
2759         my $cor = $d->find_element( 'Genetic correlation',
2760             'partial_link_text', 'scroll up' );
2761         $d->driver->execute_script(
2762             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
2763             $cor );
2764         sleep(5);
2765         $d->find_element_ok( 'si_pops_select', 'id', 'select list sl pop' )
2766           ->click();
2767         sleep(3);
2768         $d->find_element_ok(
2769 '//select[@id="si_pops_select"]/option[text()="Training population 2804608595"]',
2770             'xpath',
2771             'select combo pop'
2772         )->click();
2773         sleep(3);
2774         $d->find_element_ok( 'DMCP', 'id', 'rel wt 1st' )->send_keys(3);
2775         sleep(5);
2776         $d->find_element_ok( 'FRW', 'id', 'rel wt 2st' )->send_keys(5);
2777         sleep(5);
2778         $d->find_element_ok( 'calculate_si', 'id', 'calc selection index' )
2779           ->click();
2780         sleep(50);
2782         my $clustering =
2783           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
2784         $d->driver->execute_script(
2785             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
2786             $clustering );
2787         sleep(5);
2788         $d->find_element_ok( 'cluster_pops_select', 'id', 'click cluster pops' )
2789           ->click();
2790         sleep(3);
2791         $d->find_element_ok(
2792 '//select[@id="cluster_pops_select"]/option[text()="2804608595-DMCP-3-FRW-5"]',
2793             'xpath', 'si'
2794         )->click();
2795         sleep(5);
2796         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
2797             'xpath', 'select k-means' )->send_keys('K-means');
2798         sleep(2);
2799         $d->find_element_ok(
2800 '//select[@id="cluster_data_type_select"]/option[text()="Genotype"]',
2801             'xpath', 'genotype'
2802         )->click();
2803         sleep(2);
2804         $d->find_element_ok(
2805             '//*[starts-with(@id, "selection_proportion_input")]',
2806             'xpath', 'fill in sel prop' )->send_keys('15');
2807         sleep(2);
2808         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2809             'xpath', 'clear k number' )->clear();
2810         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2811             'xpath', 'select k number' )->send_keys(4);
2812         sleep(2);
2813         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
2814             'xpath', 'run cluster' )->click();
2815         sleep(3);
2816         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
2817         sleep(140);
2818         $d->find_element_ok(
2819 '//img[@id="k-means-plot-2804608595-2804608595-DMCP-3-FRW-5-genotype-k-4-gp-1-sp-15"]',
2820             'xpath', 'plot'
2821         )->click();
2822         sleep(5);
2824         $d->driver->refresh();
2825         sleep(5);
2827 # #$d->get_ok('/solgs/models/combined/trials/2804608595/traits/1971973596/gp/1', 'combined trials models summary page');
2828         ## sleep(5);
2830         my $sel_pops =
2831           $d->find_element( 'Predict', 'partial_link_text', 'scroll up' );
2832         my $elem = $d->driver->execute_script(
2833             "arguments[0].scrollIntoView(true);window.scrollBy(0, -600);",
2834             $sel_pops );
2835         sleep(5);
2836         $d->find_element_ok( 'list_type_selection_pops_select',
2837             'id', 'select clones list menu' )->click();
2838         sleep(5);
2839         my $dataset = $d->find_element_ok(
2840 '//select[@id="list_type_selection_pops_select"]/option[text()="'
2841               . $accessions_dt_name . '"]',
2842             'xpath',
2843             'select dataset sel pop'
2844         );
2845         $dataset->click();
2846         sleep(5);
2847         $d->find_element_ok(
2848             '//div[ @id="list_type_selection_pop_go_btn"]/input[@value="View"]',
2849             'xpath',
2850             'select list sel pop'
2851         )->click();
2852         sleep(15);
2854         my $clustering =
2855           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
2856         $d->driver->execute_script(
2857             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
2858             $clustering );
2859         sleep(5);
2860         $d->find_element_ok( 'cluster_pops_select', 'id',
2861             'select dataset type sl pop - GEBV' )->click();
2862         sleep(3);
2863         $d->find_element_ok(
2864             '//select[@id="cluster_pops_select"]/option[text()="'
2865               . $accessions_dt_name . '"]',
2866             'xpath',
2867             'select dataset sel pop'
2868         )->click();
2869         sleep(3);
2870         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
2871             'xpath', 'select k-means' )->send_keys('K-means');
2872         sleep(2);
2873         $d->find_element_ok(
2874             '//select[@id="cluster_data_type_select"]/option[text()="GEBV"]',
2875             'xpath', 'select gebv' )->click();
2876         sleep(2);
2877         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2878             'xpath', 'clear k number' )->clear();
2879         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
2880             'xpath', 'select k number' )->send_keys(4);
2881         sleep(2);
2882         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
2883             'xpath', 'run GEBV cluster' )->click();
2884         sleep(3);
2885         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
2886         sleep(200);
2887         $d->find_element_ok(
2888             '//img[@id="k-means-plot-2804608595-'
2889               . $accessions_dt_id
2890               . '-traits-1971973596-gebv-k-4"]',
2891             'xpath',
2892             'check k-means plot'
2893         )->click();
2894         sleep(3);
2896         $d->driver->refresh();
2897         sleep(5);
2899         my $sel_pops =
2900           $d->find_element( 'Predict', 'partial_link_text', 'scroll up' );
2901         my $elem = $d->driver->execute_script(
2902             "arguments[0].scrollIntoView(true);window.scrollBy(0, -600);",
2903             $sel_pops );
2904         sleep(5);
2905         $d->find_element_ok( 'list_type_selection_pops_select',
2906             'id', 'select clones list menu' )->click();
2907         sleep(5);
2908         my $dataset = $d->find_element_ok(
2909 '//select[@id="list_type_selection_pops_select"]/option[text()="'
2910               . $accessions_dt_name . '"]',
2911             'xpath',
2912             'select dataset sel pop'
2913         );
2914         $dataset->click();
2915         sleep(5);
2916         $d->find_element_ok(
2917             '//div[ @id="list_type_selection_pop_go_btn"]/input[@value="View"]',
2918             'xpath',
2919             'select list sel pop'
2920         )->click();
2921         sleep(15);
2923         my $clustering =
2924           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
2925         $d->driver->execute_script(
2926             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
2927             $clustering );
2928         sleep(5);
2929         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
2930           ->click();
2931         sleep(3);
2932         $d->find_element_ok(
2933             '//select[@id="cluster_pops_select"]/option[text()="'
2934               . $accessions_dt_name . '"]',
2935             'xpath',
2936             'select dataset sel pop'
2937         )->click();
2938         sleep(3);
2939         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
2940             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
2941         sleep(2);
2942         $d->find_element_ok(
2943             '//select[@id="cluster_data_type_select"]/option[text()="GEBV"]',
2944             'xpath', 'select gebv' )->click();
2945         sleep(2);
2946         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
2947             'xpath', 'run cluster' )->click();
2948         sleep(3);
2949         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
2950         sleep(130);
2951         $d->find_element_ok(
2952             '//img[@id="hierarchical-plot-2804608595-'
2953               . $accessions_dt_id
2954               . '-traits-1971973596-gebv"]',
2955             'xpath',
2956             'check hierarchical plot'
2957         )->click();
2958         sleep(3);
2960         $d->driver->refresh();
2961         sleep(5);
2963         my $sel_pops =
2964           $d->find_element( 'Predict', 'partial_link_text', 'scroll up' );
2965         my $elem = $d->driver->execute_script(
2966             "arguments[0].scrollIntoView(true);window.scrollBy(0, -200);",
2967             $sel_pops );
2969         $d->find_element_ok(
2970             '//div[ @id="list_type_selection_pop_go_btn"]/input[@value="View"]',
2971             'xpath',
2972             'select list type sel pop'
2973         )->click();
2974         sleep(5);
2975         $d->find_element_ok( 'list_type_selection_pops_select',
2976             'id', 'select clones list menu' )->click();
2977         sleep(5);
2978         my $list = $d->find_element_ok(
2979 '//select[@id="list_type_selection_pops_select"]/option[text()="'
2980               . $accessions_list_name . '"]',
2981             'xpath',
2982             'select list sel pop'
2983         );
2984         $list->click();
2985         sleep(5);
2986         $d->find_element_ok(
2987             '//div[ @id="list_type_selection_pop_go_btn"]/input[@value="View"]',
2988             'xpath',
2989             'select list sel pop'
2990         )->click();
2991         sleep(15);
2993         my $clustering =
2994           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
2995         $d->driver->execute_script(
2996             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
2997             $clustering );
2998         sleep(5);
2999         $d->find_element_ok( 'cluster_pops_select', 'id',
3000             'select list type sl pop -- GEBV' )->click();
3001         sleep(3);
3002         $d->find_element_ok(
3003             '//select[@id="cluster_pops_select"]/option[text()="'
3004               . $accessions_list_name . '"]',
3005             'xpath',
3006             'select list sel pop'
3007         )->click();
3008         sleep(3);
3009         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
3010             'xpath', 'select k-means' )->send_keys('K-means');
3011         sleep(2);
3012         $d->find_element_ok(
3013             '//select[@id="cluster_data_type_select"]/option[text()="GEBV"]',
3014             'xpath', 'select gebv' )->click();
3015         sleep(2);
3016         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
3017             'xpath', 'clear k number' )->clear();
3018         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
3019             'xpath', 'select k number' )->send_keys(4);
3020         sleep(2);
3021         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
3022             'xpath', 'run cluster' )->click();
3023         sleep(3);
3024         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
3025         sleep(180);
3026         $d->find_element_ok(
3027             '//img[@id="k-means-plot-2804608595-'
3028               . $accessions_list_id
3029               . '-traits-1971973596-gebv-k-4"]',
3030             'xpath',
3031             'check k-means plot'
3032         )->click();
3033         sleep(3);
3035         $d->driver->refresh();
3036         sleep(3);
3038         my $clustering =
3039           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
3040         $d->driver->execute_script(
3041             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
3042             $clustering );
3043         sleep(5);
3044         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
3045           ->click();
3046         sleep(3);
3047         $d->find_element_ok(
3048 '//select[@id="cluster_pops_select"]/option[text()="trial2 NaCRRI"]',
3049             'xpath',
3050             'select trial sel pop'
3051         )->click();
3052         sleep(3);
3053         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
3054             'xpath', 'select k-means' )->send_keys('K-means');
3055         sleep(2);
3056         $d->find_element_ok(
3057 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
3058             'xpath',
3059             'select genotype'
3060         )->click();
3061         sleep(2);
3062         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
3063             'xpath', 'clear k number' )->clear();
3064         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
3065             'xpath', 'select k number' )->send_keys(4);
3066         sleep(2);
3067         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
3068             'xpath', 'run cluster' )->click();
3069         sleep(3);
3070         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
3071         sleep(200);
3072         $d->find_element_ok(
3073 '//img[@id="k-means-plot-2804608595-141-traits-1971973596-genotype-k-4-gp-1"]',
3074             'xpath', 'check k-means plot'
3075         )->click();
3076         sleep(5);
3078         $d->driver->refresh();
3079         sleep(3);
3081         my $clustering =
3082           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
3083         $d->driver->execute_script(
3084             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
3085             $clustering );
3086         sleep(5);
3087         $d->find_element_ok( 'cluster_pops_select', 'id', 'select list sl pop' )
3088           ->click();
3089         sleep(3);
3090         $d->find_element_ok(
3091 '//select[@id="cluster_pops_select"]/option[text()="trial2 NaCRRI"]',
3092             'xpath',
3093             'select trial sel pop'
3094         )->click();
3095         sleep(3);
3096         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
3097             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
3098         sleep(2);
3099         $d->find_element_ok(
3100             '//select[@id="cluster_data_type_select"]/option[text()="GEBV"]',
3101             'xpath', 'select gebv' )->click();
3102         sleep(2);
3103         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
3104             'xpath', 'run cluster' )->click();
3105         sleep(3);
3106         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
3107         sleep(40);
3108         $d->find_element_ok(
3109 '//img[@id="hierarchical-plot-2804608595-141-traits-1971973596-gebv"]',
3110             'xpath', 'check hierarchical plot'
3111         )->click();
3112         sleep(3);
3114         $d->driver->refresh();
3115         sleep(3);
3117         # #
3118         my $clustering =
3119           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
3120         $d->driver->execute_script(
3121             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
3122             $clustering );
3123         sleep(5);
3124         $d->find_element_ok( 'cluster_pops_select', 'id',
3125             'select trial sl pop -- GEBV' )->click();
3126         sleep(3);
3127         $d->find_element_ok(
3128 '//select[@id="cluster_pops_select"]/option[text()="trial2 NaCRRI"]',
3129             'xpath',
3130             'select trial sel pop'
3131         )->click();
3132         sleep(3);
3133         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
3134             'xpath', 'select k-means' )->send_keys('K-means');
3135         sleep(2);
3136         $d->find_element_ok(
3137             '//select[@id="cluster_data_type_select"]/option[text()="GEBV"]',
3138             'xpath', 'select gebv' )->click();
3139         sleep(2);
3140         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
3141             'xpath', 'clear k number' )->clear();
3142         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
3143             'xpath', 'select k number' )->send_keys(4);
3144         sleep(2);
3145         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
3146             'xpath', 'run cluster' )->click();
3147         sleep(3);
3148         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
3149         sleep(140);
3150         $d->find_element_ok(
3151 '//img[@id="k-means-plot-2804608595-141-traits-1971973596-gebv-k-4"]',
3152             'xpath', 'check k-means plot'
3153         )->click();
3154         sleep(3);
3156         $d->driver->refresh();
3157         sleep(3);
3159         my $clustering =
3160           $d->find_element( 'Models summary', 'partial_link_text',
3161             'scroll up' );
3162         $d->driver->execute_script(
3163             "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);",
3164             $clustering );
3165         sleep(5);
3166         $d->find_element_ok(
3167             '//table[@id="model_summary"]//*[contains(text(), "DMCP")]',
3168             'xpath', 'go to  training model pg' )->click();
3169         sleep(5);
3171         my $clustering =
3172           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
3173         $d->driver->execute_script(
3174             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
3175             $clustering );
3176         sleep(5);
3178         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
3179             'xpath', 'select k-means' )->send_keys('K-means');
3180         sleep(2);
3181         $d->find_element_ok(
3182 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
3183             'xpath',
3184             'select genotype'
3185         )->click();
3186         sleep(2);
3187         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
3188             'xpath', 'clear k number' )->clear();
3189         $d->find_element_ok( '//*[starts-with(@id, "k_number_input")]',
3190             'xpath', 'select k number' )->send_keys(4);
3191         sleep(2);
3192         $d->find_element_ok(
3193             '//*[starts-with(@id, "run_cluster")]',
3194             'xpath',
3195             'run genotype cluster'
3196         )->click();
3197         sleep(3);
3198         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
3199         sleep(200);
3200         $d->find_element_ok(
3201             '//img[@id="k-means-plot-2804608595-70741-genotype-k-4-gp-1"]',
3202             'xpath', 'check k-means plot' )->click();
3203         sleep(5);
3205         $d->driver->refresh();
3206         sleep(3);
3208         my $clustering =
3209           $d->find_element( 'Clustering', 'partial_link_text', 'scroll up' );
3210         $d->driver->execute_script(
3211             "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);",
3212             $clustering );
3213         sleep(5);
3215         $d->find_element_ok( '//*[starts-with(@id, "cluster_type_select")]',
3216             'xpath', 'select hierarchical' )->send_keys('Hierarchical');
3217         sleep(2);
3218         $d->find_element_ok(
3219 '//*[starts-with(@id, "cluster_data_type_select")]/option[text()="Genotype"]',
3220             'xpath',
3221             'select genotype'
3222         )->click();
3223         sleep(2);
3224         $d->find_element_ok( '//*[starts-with(@id, "run_cluster")]',
3225             'xpath', 'run cluster' )->click();
3226         sleep(3);
3227         $d->find_element_ok( 'no_queue', 'id', 'no job queueing' )->click();
3228         sleep(130);
3229         $d->find_element_ok(
3230             '//img[@id="hierarchical-plot-2804608595-70741-genotype-gp-1"]',
3231             'xpath', 'check hierarchical plot' )->click();
3232         sleep(5);
3234         foreach
3235           my $list_id ( $trials_list_id, $accessions_list_id, $plots_list_id )
3236         {
3237             $list_id =~ s/\w+_//g;
3238             $solgs_data->delete_list($list_id);
3239         }
3241         foreach
3242           my $dataset_id ( $trials_dt_id, $accessions_dt_id, $plots_dt_id )
3243         {
3244             $dataset_id =~ s/\w+_//g;
3245             $solgs_data->delete_dataset($dataset_id);
3246         }
3248     }
3251 done_testing();