I created a test a couple years back where I had to scroll through a list of pop-up answers to be sure there was at least one particular answer in that pop-up list. Works fine - you set a variable as false, scroll through the list of pop-up possibilities, and if the string you’re looking for is found, change the variable to true -
I need to do something similar, but scrolling through a column of a table. I’m not sure what my target should be. I need to search the Column “Spectro Command” and find at least one instance of “CalibrateWhite” and one instance of “CalibrateBlack.”
I have been messing with this for the past two days. So I’ve found one ALMOST workaround.
First, I verify that it does NOT say “No matching records found” -
by using
verifyNotText | xpath=//table[@id='spectroListTable']/tbody/tr/td | No matching records found
If my table returns any records, it should look like this -
Now I just need to find one instance of CalibrateWhite in that field and one instance of CalibrateBlack. I am trying to make an If/Else work here -
But when I run it, it does NOT store “true” into either variable -
[info] Store ‘xpath=//table[@id=‘spectroListTable’]/tbody/tr/td[3]’ into ‘spectroCommand’
[info] Expand variable ‘${spectroCommand}’ into ‘xpath=//table[@id=‘spectroListTable’]/tbody/tr/td[3]’
[info] echo: xpath=//table[@id=‘spectroListTable’]/tbody/tr/td[3]
[info] Store ‘false’ into ‘hasWhite’
[info] Store ‘false’ into ‘hasBlack’
[info] Expand variable ‘“${spectroCommand}”.includes(“CalibrateWhite”)’ into ‘“xpath=//table[@id=‘spectroListTable’]/tbody/tr/td[3]”.includes(“CalibrateWhite”)’
[info] Expand variable ‘“${spectroCommand}”.includes(“CalibrateBlack”)’ into ‘“xpath=//table[@id=‘spectroListTable’]/tbody/tr/td[3]”.includes(“CalibrateBlack”)’
[info] Expand variable ‘${hasWhite}’ into ‘false’
[info] echo: false
[info] Expand variable ‘${hasBlack}’ into ‘false’
[info] echo: false
Someone have a way I can make this work?