Highlighted
Absent Member.
Absent Member.
302 views

Click does not work

Hi all,

I have to navigate through the code by:

Browser("nnnnn").Page("nnnnnn").WebElement(obj_Desc).object.parentNode.nextSibling.childNodes.item(0).firstChild.childNodes.item(4).CLICK
does not work. although:

1)the outerhtml method shows the correct SPAN tag:
<SPAN class="x-tree3-node-text" unselectable="on">Untersuchung (1)</SPAN>

2) If I do Descriptive Programming or Capture Replay on the SPAN tag the Click method WORKS.(Even that attribute says:unselectable="on")

But why it does not execute the Click method in the topest statement.

Any help R E A L L Y appreciated.

Wolfgang

0 Likes
5 Replies
Highlighted
Knowledge Partner
Knowledge Partner

Re: Click does not work

Have you verified the HTML is not Dynamic, if you record the click does it always playback?

Mark Smith.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Click does not work

Hi,

use also ...CLICK 5,5, "LEFT"

However, do you get an error message?

Can you attach a screen shot where we can see the hierarchie of your Webelement ?

...WebElement(obj_Des​c).object.parentNode.nextSibling.childNodes.item(0​).firstChild.childNodes.item(4).CLICK

 

 

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Click does not work

If I do:

Browser("nnnnn").Page("nnnnnn").WebElement(obj_Desc).object.parentNode.nextSibling.childNodes.item(0).firstChild.childNodes.item(4).OUTERHTML
I get: <SPAN class="x-tree3-node-text" unselectable="0n">Untersuchung (1) <Span>  

 

This SPAN is the correct one, because:

obj_Desc("html tag").value= "SPAN"
obj_Desc("innertext").value="Untersuchung /(1/)"
obj_Desc("class").value= "x-tree3-node-text"
'Browser("megaMANAGER").Page("megaMANAGER").WebElement(obj_Desc).Click

WORKS

 

 

 

How can I get the correct OUTERHTML method, but theCLICK method is not workng. Is there any other QTP reason for or is my thinking corrupt....

 

BUT if OUTERHTML finds the correct HTML Tag does this mean in any case that the correct OBJECT has been found?

 

Best regards
Wolfgang

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: Click does not work

Wolf I'm assuming there is a reason why you can't simplify the click to:

Browser("X").Page("Y").WebElement("innerText:=Untersuchung.*")

What is the reason for using the more complicated method?

Mark Smith.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Click does not work

I have to use this complicated code, because it is a tree and it could happen that there is somewhere in the tree already a tree leave open which has a node or element with the same name.

In order to use the simplified code I would need to add an index of the tag I want to open.

 

The best thing is: If I go from this SPAN tag, where the Click does not work, and navigate even further to an arrow image : I can click on that arrow!

 

Browser("megaMANAGER").Page("megaMANAGER").WebElement(obj_Desc).Object.parentNode.nextSibling.childNodes.item(0).firstChild.childNodes.item(4).parentNode.childNodes.item(1).Click  works on that arrow image.

 

AS I know SPAN tags are anyway different, could it be that QTP cannot raise the Click event on a SPAN tag when Object Navigation is used?

 

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.