Hello,
The thing I want to establish is to randomly select a document from a list of documents, then store the Xpath that uniquely identifies it for later use (I have to access the same doc on the same webpage lateron in the script).
In the Object section of the step where the document is identified I put the following code:
var Item = evalXPath("/html/body/div[3]/div/div[1]/div[1]/div[2]/div[1]/div/div[1]/div[2]/div[2]/div/div/div[2]/div[1]/div/div[2]/div[2]/div[2]/div/div/div[1]/div[1]/div[2]/div/div/table/tbody/tr[1]/td[1]/div/a/span/span[3]/span");
var docitem = random(Item);
ArgsContext.LR.setParam("documentitem",docitem);
ArgsContext.LR.getParam("documentitem");
I get "target object was not found"
However when I change the code to :
var Item = evalXPath("/html/body/div[3]/div/div[1]/div[1]/div[2]/div[1]/div/div[1]/div[2]/div[2]/div/div/div[2]/div[1]/div/div[2]/div[2]/div[2]/div/div/div[1]/div[1]/div[2]/div/div/table/tbody/tr[1]/td[1]/div/a/span/span[3]/span");
var docitem = random(Item);
docitem;
It works and the document is randomly selected.
I am busting my brains as to why this doesn't work.Is it impossible to store an EvalXpath into a parameter?
This concerns HP-PC 11.52 Patch 1.
Any help is appreciated!
Regards,
Peet