ATF - Assert Text on Page (Custom UI) support wildcards

leon reynolds
Tera Expert

I am trying to use Assert Text on Page (Custom UI) in ATF to check the text on the message that is output once I have created a security incident from an incident. Is there anyway I can use wildcards in the text search, because currently I have to stop my check at the first number. i.e.

 

find_real_file.png

 

The output message is 

find_real_file.png

1 ACCEPTED SOLUTION

leon reynolds
Tera Expert

I was able to fix this by writing a client script to grab next number to be used from sys_number_counter and then pasting that value into the text field so I could check the complete string.

View solution in original post

4 REPLIES 4

leon reynolds
Tera Expert

I was able to fix this by writing a client script to grab next number to be used from sys_number_counter and then pasting that value into the text field so I could check the complete string.

Great leon.

could u pls share the script?

 

Thanks and regards,

Ramakrishna

Good work leon,

can you pls share the script?

leon reynolds
Tera Expert

Apologies for the delay, here is the sample code.

// table name and timeout are input parameters, it outputs the number.

var urecord = inputs.u_table_for_next_no.toString();
	
if (urecord != null && urecord != '') {
	var query = new GlideRecord('sys_number_counter');
	var equery = 'table=' + urecord;
	var counter = 0; 
	var noLen = 0;
	while (counter <= timeout) {
		query.setLimit(1);
		query.initialize();
		query.addEncodedQuery(equery);
		query.query();
		if (query.next()) {
			var newno = (query.number + 1);
				
			noLen = 7;
			outputs.u_next_number = zeroPadding(newno, noLen);
			}
		counter++;
		gs.sleep(1000);
		}
	}
	
}


function zeroPadding(number,length) 
{
  return (Array(length).join('0') + number).slice(-length);
}