NicolaFilosa_SE
2 years agoContributor
Using array values in xpath
Hi to everyone. I want to do a for cycle with elements defined by an xpath. The values that the for cycle uses are defined in an array. How can I insert the elements of the array in the xpath? pageP...
- 2 years ago
Something like this?
function TestIt() { var rowPar = [ "rowPar1", "rowPar2", "rowPar3", "rowPar4", "rowPar5" ]; for (var i = 0; i < rowPar.length; i++) { var str = "//tr[@id='" + rowPar[i] + "']/td[contains(@class, 'valdev')]"; //pageParameterDevice.FindElement(str).contentText Log.Message(str); } }
Construct the string, and then pass the str into FindElement()