Hi
I try to locate the dialogpopup with YES button:
<a id="Template_CtmTheme_wt7_block_wtMainContent_ConfirmationDialog_wt47_block_wt16" tabindex="45" class="conf-dialog-button gray" onclick="ConfirmationDialog_Cancel('Template_CtmTheme_wt7_block_wtMainContent_ConfirmationDialog_wt47_block_wtPopUpMainContainer','Template_CtmTheme_wt7_block_wtActions_wtCancelLink');return false;OsAjax(arguments[0] || window.event,'Template_CtmTheme_wt7_block_wtMainContent_ConfirmationDialog_wt47_block_wt16','Template_CtmTheme_wt7$block$wtMainContent$ConfirmationDialog_wt47$block$wt16','','__OSVSTATE,',''); return false;" href="#">No</a>
<a id="Template_CtmTheme_wt7_block_wtMainContent_ConfirmationDialog_wt47_block_wt8" tabindex="44" class="conf-dialog-button blue" onclick="ConfirmationDialog_Continue('Template_CtmTheme_wt7_block_wtMainContent_ConfirmationDialog_wt47_block_wtPopUpMainContainer','Template_CtmTheme_wt7_block_wtActions_wtCancelLink',clickTemplate_CtmTheme_wt7_block_wtActions_wtCancelLink);return false;OsAjax(arguments[0] || window.event,'Template_CtmTheme_wt7_block_wtMainContent_ConfirmationDialog_wt47_block_wt8','Template_CtmTheme_wt7$block$wtMainContent$ConfirmationDialog_wt47$block$wt8','','__OSVSTATE,',''); return false;" href="#">Yes</a>
Now i need to hardcode it as
d.findElement(By.cssSelector("a[id*='ConfirmationDialog_wt47_block_wt8']")).click();
however the part wt47 and wt8 will be changing.
Is there any way to handle it better?
I did try:
d.findElement(By.cssSelector("a[onclick*='ConfirmationDialog_Continue'][id*='ConfirmationDialog']")).click();
d.findElement(By.cssSelector("a[id*='ConfirmationDialog'][class*='blue']")).click();
d.findElement(By.cssSelector("a[class^='conf'][class$='blue']")).click();
but no luck
Can I look at YES and NO directly?
Thanks