18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Usage of parentNode in Java
Hi,
I have two objects (One Div, and One Input) on the screen with following xpaths. (Only last part of the xpath is pasted here).
On screen the div and input are shown in the same row. To make a logical reference, I need to setValue of the input based on the corresponding input.
The div has a text value that is being used as identifier. (Kind of a row label)
I am trying to use the following code but I don't get any result. It's always "Error: The first parameter passed to _setValue was not found on the browser".
If the text in div tag is "label",
I have two objects (One Div, and One Input) on the screen with following xpaths. (Only last part of the xpath is pasted here).
Object 1: table/tbody/tr[2]/td[2]/table/tbody/tr/td/table/tbody/tr/td/div
Object 2: table/tbody/tr[2]/td[3]/input
On screen the div and input are shown in the same row. To make a logical reference, I need to setValue of the input based on the corresponding input.
The div has a text value that is being used as identifier. (Kind of a row label)
I am trying to use the following code but I don't get any result. It's always "Error: The first parameter passed to _setValue was not found on the browser".
If the text in div tag is "label",
browser.textbox(0).in(browser.cell(2).in(browser.div("label").parentNode("TR",3))).setValue("testValue");
Comments
browser.textbox(0).near(browser.div("Your label")).setValue("testValue")
?
I think your element is just above that node. Try:
browser.textbox(0).near(browser.div("Your label").parentNode("TABLE")).setValue("testValue")
In my case the div element is 8 levels down. Are you sure _near looks 7 levels up? or is it 7 levels down? In any case, what is the workaround you would suggest for more than 7 levels?