Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is this one instance where descriptive programming does not work?
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
I cant seem to find anything to make it unique on this object here.

It is a Image. Once you click on it, it is suppose to go to the next page.

Here is what QTP10 capture:

Code:
Browser("Delta - Book a flight").Page("Delta - Book a flight").Image("red_arrow").Click

Here is what I did:

Code:
Browser("name:=Delta - Book a flight").Page("title:=Delta - Book a flight").Image("file name:=red_arrow.gif", "abs_x:=1236", "abs_y:=393").Click

The problem is that all the red arrow button have this same name and I cant find anything unique.

About the abs_x and abs_y, if you resize the browser, everything change too. So it is way way too dynamic.

Any trick on this thing?

Thanks for your help!


Attached Files Image(s)
       
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
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.

Thanks,
SUpputuri
Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
Thank you so much Supputuri. I will check this out. Thanks again!
Reply
#4
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi,

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.

Regards
Vibha
Reply
#5
Solved: 11 Years, 4 Months, 3 Weeks ago
Hello everyone.

I am very confused here.

I want to strickly use DP and no recording our using OD. Can give me an example or give me hint?

Tell me which screenshot you would like to see.

Thanks for helping.
Reply
#6
Solved: 11 Years, 4 Months, 3 Weeks ago
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


Attached Files Image(s)
           
Reply
#7
Solved: 11 Years, 4 Months, 3 Weeks ago
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!


Attached Files Image(s)
   
Reply
#8
Solved: 11 Years, 4 Months, 3 Weeks ago
Dead in the water.

I knew QTP cant do everything. Or maybe I can do anything. :-)
Reply
#9
Solved: 11 Years, 4 Months, 3 Weeks ago
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.

5. If you got clues, let me know. :-)
Reply
#10
Solved: 11 Years, 4 Months, 3 Weeks ago
I have solve my problem and this code below work!

Code:
Browser("name:=Delta - Book a flight").Page("title:=Delta - Book a flight").WebElement("html tag:=DIV", "innertext:=Select", "index:=0").Click

It was that easy! Yet I didnt know!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Descriptive PROGRAMMING sandeepm1989 0 2,126 01-21-2016, 11:46 AM
Last Post: sandeepm1989
  ERROR : Object reference not set to an instance of an object. Suyashxp 2 7,292 12-30-2014, 11:32 AM
Last Post: ursprasadp
  How to run QTP from QC on a remote citrix instance? sreekanth 1 4,905 07-29-2013, 12:24 AM
Last Post: ravi.gajul
  Descriptive Programming By giving the description in form of the string arguments sia sharma 6 5,347 09-12-2012, 08:57 PM
Last Post: freeboynil
  Can you use Descriptive Programming with Checkpoint? chong67 4 8,746 06-27-2012, 10:29 AM
Last Post: sshukla12

Forum Jump:


Users browsing this thread: 1 Guest(s)