06-25-2012, 11:13 PM (This post was last modified: 06-25-2012, 11:36 PM by supputuri.)
Add the Economy(T) webelement which will include the red button and then the Frist(A) webelement webelement with red button. now you can work easly on them. Let me know if you need any details
Sorry, I was referring to OR.
Yes,you can handle this.... But you have to use x,y values so that even if the application is resized the coordinates won't get affected.
But I would not prefer using the co-ordinates until it's mandatory.
other good Options:
1) Use the webtable object so that it will be identified easly.
2) Rather you can create the child item object for the red button using DP and then click on that.
Please let me know if you need any detailed steps.
You can add one user defined properties to the OR of the image you want to click and then use this user defined property while describing it through DP in the code. So then QTP will use only that RED image.
06-26-2012, 10:50 PM (This post was last modified: 06-26-2012, 11:05 PM by chong67.)
Hello everyone.
I got an update now.
Please see my latest screenshot. I include the Webtable and WebElement.
Keep in mind that this table is very dynamic. We dont know what price and flight will come back. See the first screenshot.
I just cant do DP on it.
QTP says cannot find this below:
Browser("name:=Delta - Book a flight").Page("title:=Delta - Book a flight").WebElement("class:=opA2_left", "x:=564", "y:=600", "outertext:=Select").Click
06-27-2012, 12:49 AM (This post was last modified: 06-27-2012, 12:50 AM by chong67.)
I use this below:
Code:
Browser("name:=Delta - Book a flight").Page("title:=Delta - Book a flight").WebTable( "html tag:=TABLE", "cols=3", "rows:=6").WebElement("html tag:=DIV", "class:=opA2_left", "innerhtml:=Select").Click
I am getting this error message below.
I am trying very hard. Please help if you can. Thanks so much!
1. It seems like QTP will not work if you have a "Click" even with "Web Table" ??? That is what happened on this error msg above.
2. I did this and it work:
Browser("name:=Delta - Book a flight").Page("title:=Delta - Book a flight").WebElement("class:=fareButton center", "html id:=fareButton2", "x:=536", "y:=577").Click
3. The problem is that when I go to another machine to test it, it doesnt work again. I bet "x" and "y" coordinates are not fix target at all.
4. I dont know what to do next. I will post on other forums and see.