Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to capture value of Webelement which is changing dynamically
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi All,

I am trying to automate a web application developed in Java. Attached is the screenshot. In the screen, I want to capture the value of Issue# which is 12544 in the screen. When I capture the property of the object its seen as Browser-> Page -> WEbElement -> WebTable ->innertext.

But the value of WebTable changes dynamically like WebTable,WebTable_1,WebTable_2. I used regular expression for this and I am trying to capture the value currently as

Code:
Browser("AES - CATS - Login >>").Page("Whitepaper Summary
Page_2").WebElement("Name:=WebTable.*").GetROProperty("innertext")

But I am getting a run-time error saying - The "[ WebElement ]" object's description matches more than one of the objects currently displayed in your application. Add additional properties to the object description in order to uniquely identify the object.

Please can you help me in identifying the object uniquely and capturing the value...

Regards,
Sheetal


Attached Files Image(s)
   
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi,
As per the object state mentioned i.e,
Browser-> Page -> WEbElement -> WebTable ->innertext.

Then it will comes like this
Code:
Browser("xxxX").Page("xxxxx").WebElement("xxxx").WebTable("xxxxxx").getcelldata(row,column)

But ur code seems
Code:
Browser("AES - CATS - Login >>").Page("Whitepaper Summary
Page_2").WebElement("Name:=WebTable.*").GetROProperty("innertext")

Here u were capturing innertext directly from webelement instead of webtable

Finally after getting the cell value then use the Mid function to capture the required value from the cell

Try with this and let me know if u have any issues..
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Sheetal -
Can you provide a spyshot of the Webelement ? It is necessary because i believe the name of the webelement is webtable and not a webtable there actually.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
Thanks for the replies...

Basanth @ - As u told the WebTable is name of Webelement and not a webTable object as such. I have attached the screenshot.

Venkat@ - Since there is no WebTable object I cannot use the fucntion you have mentioned below.

Sorry for the wrong information. I am attaching the ObjectSPy screenshot. Please can you have a look at it and help me out..


Attached Files Image(s)
   
Reply
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi Sheetal,
Did u try like this
Code:
Browser("xxxX").Page("xxxxx").WebElement("xxxx").WebTable("Issue #").GetRoProperty(“text”)


sorry it is

Code:
Browser("xxxX").Page("xxxxx").WebTable("Issue #").GetRoProperty
(“text”)

use webtable instead of webelement to get the dynamic value
Reply
#6
Solved: 11 Years, 3 Months, 4 Weeks ago
I am unable to use WebTable directly under Page. Please can you suggest any other solution.
Reply
#7
Solved: 11 Years, 3 Months, 4 Weeks ago
try using one more property like index with the name. like-
Code:
Browser("AES - CATS - Login >>").Page("Whitepaper Summary
Page_2").WebElement("Name:=WebTable.*","index:=1").GetROProperty("innertext")

Reply
#8
Solved: 11 Years, 3 Months, 4 Weeks ago
But your screenshot is showing that webtable("Issue#") has been placed under "Page"

So while adding the object to object repository add this object as webtable, then your problem will resolve
Reply
#9
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi all...Iam stuck up with an issue from three days...could some one help me to understand how to click a security question which changes during every run time...in an other words it changes evry time when i close and open the security questions page
eg : Browser("ABC").Page("abc").Webelement("xyz").Click .... it works for the first time ..but in the nect Run xyz changes to Webelement("123") or Webelement("rrr") and qtp is unable to identify this question and it fails the Script...
Reply
#10
Solved: 11 Years, 3 Months, 4 Weeks ago
(07-30-2012, 01:34 PM)qtp.sandeep Wrote: Hi all...Iam stuck up with an issue from three days...could some one help me to understand how to click a security question which changes during every run time...in an other words it changes evry time when i close and open the security questions page
eg : Browser("ABC").Page("abc").Webelement("xyz").Click .... it works for the first time ..but in the nect Run xyz changes to Webelement("123") or Webelement("rrr") and qtp is unable to identify this question and it fails the Script...

hiee sandeep , did you get solution for this isue. if yes please share with me. because i am stuck in this since 4 days.
thank you
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  UFT issues with Outsystems dynamically generated Id/names jherron 2 1,363 03-02-2020, 09:33 PM
Last Post: Swishy70
  Unable to click on dynamically changing webelement preeti 0 1,817 04-29-2017, 08:50 PM
Last Post: preeti
  Page element keep changing chong67 4 4,640 11-08-2016, 09:17 PM
Last Post: Paul Rammone
Exclamation WebElement("WebElement").Click is not working sia sharma 7 23,959 09-28-2016, 08:58 PM
Last Post: supputuri
  Adding data into rows that add dynamically with setcelldata azar81 4 5,936 04-13-2015, 05:24 PM
Last Post: vidya2k2

Forum Jump:


Users browsing this thread: 1 Guest(s)