Skip to main content
Question

JavaScript doubt


Forum|alt.badge.img+1

const deviceManagement = document.querySelector('body > form:nth-child(21) > table:nth-child(4) > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(1) > div:nth-child(6) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(6) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2)');
deviceManagement.dispatchEvent(new MouseEvent('mouseover', { bubbles: true }));

setTimeout(() => {
  const deviceList = document.querySelector('body > div:nth-child(18) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2)');
  deviceList.click();
}, 1000);

I have this code but i can’t able to run it in the java script action.

2 replies

Forum|alt.badge.img+1

Hello, I am experiencing a similar issue with having code that works but I am unable to get it to run in AA360. Were you able to get this resolved?


Forum|alt.badge.img+3
  • Navigator | Tier 3
  • 13 replies
  • November 29, 2024

I’m having the same issue with the following code, which runs fine. But any attempt to use RegExp in javascript is returning “bot error”.

 

function string_parse(source, regex) {
    return source.match(new RegExp(regex)).toString();
}

results = string_parse(
    'PCAGoldenValleyMinneapolisOpportunities_ST20240501-ED20241101_20240820-0855-PACOA-FRV.xls',
    '^([A-Za-z0-9\\-]+)_ST(\\d{8})-ED(\\d{8})_((\\d{8}-\\d{4})-([A-Za-z0-9]+)-[A-Za-z0-9]+)\\.xls'
    //'^(?<Description>[A-Za-z0-9\\-]+)_ST(?<StartDate>\\d{8})-ED(?<EndDate>\\d{8})_(?<BidId>(?<BidDateTime>\\d{8}-\\d{4})-(?<BidCustomerCode>[A-Za-z0-9]+)-[A-Za-z0-9]+)\\.xls'
);

console.log(results);
 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings