Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to select a webelement
#1
Solved: 10 Years, 9 Months ago
Hi,

I am having some web elements in a page . how to select it
Reply
#2
Solved: 10 Years, 9 Months ago
Please provide info like screen shot , Object spy properties
Reply
#3
Solved: 10 Years, 9 Months ago
I am having a dropdown and in that i am having 8 webelements.
when i spy the dropdown it is showing as webedit inside webtable. How i need to select one value from dropdown.

I tried my setting value to webedit like
Code:
Browser(" ").page(" ").Webtable(" ").webedit(" ").set "some value"
But is it is giving a msg like object is disable.

I tried by childobjects and got the count of the webelements but is showing 6 but i am having 8 webelements and default value is select.

Please help me on the same...
Reply
#4
Solved: 10 Years, 9 Months ago
Hi ,

Try to click on the drop down arrow , which will display as 'webelement' in qtp and then in the next statement try to validate the options or click on the option , I think even the options will displayed as 'web element'.

like:
Code:
browser().page().webelement("The down arrow button").click
If browser().page().webelement("The option").exist then

end if
Reply
#5
Solved: 10 Years, 9 Months ago
I tired this but here i am checking the particular element exist or not. if exits clicking... other wise else case.

But for this i need to add very webelement into object repository rite... i think we cant do like this bec we will be passing the one of the value frm datatable...

Suppose we are having 8 web elements we need to add 8 webelements in OR?

am i thinking i rite way ? help me...

Thanks in advance
SilpaVinod
Reply
#6
Solved: 10 Years, 9 Months ago
Hi ,
No need to add them into the repository.
try to use the array and descriptive programing:
keep the unique property like 'innertext' in the array.
Code:
list_items = array("item1" , "item2" ,......"item8")

browser().page().webelement("arrow").click

for i = 0 to ubound(list_items)
if browser().page().webelement("class:=use class" , "innertext:=" & list_items(i)).exist then

print "pass"
else
print "fail"
end if
next


Note: use the identification property like 'class' , 'html id' with the use of regular expression to identify the list items , and 'innertext' to make them unique.
Reply
#7
Solved: 10 Years, 9 Months ago
Ya it is working fine thanks
Reply
#8
Solved: 10 Years, 9 Months ago
Hi,
when i am syping the object it is showing as Webelement, i am not able to identify the object what to do?
Reply
#9
Solved: 10 Years, 9 Months ago
Hi, I got the following error while using UFT 12.51 :

Cannot identify the object "Create branch:new_branch" (of class WebElement)

My code:


Code:
email_addr = "sp@xxx.com"
    pwd = "12Ka10##"
    repo = "shanti-testrepo"
    uid = "sp"
    new_branch = "branch8"

SystemUtil.Run "IExplore.exe", "https://github.com"

Browser("Sign in via LDAP · GitHub").Page("Sign in via LDAP · GitHub").WebEdit("login").Set "sp@xxx.com"
Browser("Sign in via LDAP · GitHub").Page("Sign in via LDAP · GitHub").WebEdit("password").SetSecure "568a9c124918796c14dda31b0d833acefa6c5089281f"
Browser("Sign in via LDAP · GitHub").Page("Sign in via LDAP · GitHub").WebButton("Sign in").Click
Browser("Sign in via LDAP · GitHub").Page("GitHub").Link("repo").Click
Browser("Sign in via LDAP · GitHub").Page("uid/repo").WebEdit("Find or create a branch…").Set new_branch
Browser("Sign in via LDAP · GitHub").Page("uid/repo").WebElement("Create branch: new_branch").Click



Any help is highly appreciated.
Reply
#10
Solved: 10 Years, 9 Months ago
can u send page screenshot and did you try other properties
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation WebElement("WebElement").Click is not working sia sharma 7 23,219 09-28-2016, 08:58 PM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)