My code is scanning the page source for certain constants like ' AA1 ', ' AA2 ', ' AB3 ', and so on. When a constant is found, I want to be able to access the element next to it, which has a dynamic location and changes frequently.
CONSTANTS = [' AA1 ', ' AA2 ', ' AB3 ', ' AB4 ', " AC5 ", ' AC6 ',' AN11 ',' BN12 ']
if CONSTANTS.any? {|pc| @a = pc if driver.page_source.include?(pc)}
css=.ng-scope:nth-child(3) > .ng-scope:nth-child(3).btn
Even though the page source can confirm that the item has been found, there are no id or name attributes to work with. Is there something crucial that I might have overlooked in this scenario? Your help would be greatly appreciated. Thank you.