Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to select from a dropdown list showing as an webelement?
#1
Solved: 8 Years, 3 Months, 4 Weeks ago
I want to select the particular country dynamically from the drop down list appearing as a web element.
There is no major difference in the property except x-path and coordinates for the different country showing in the dropdown list.

Below the property for a particular dropdown county:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
"Class Name:=WebElement",
"abs_x:=414",
"abs_y:=564",
"class:=",
"height:=12",
"html id:=",
"html tag:=DIV",
"innerhtml:=",
"innertext:=",
"outerhtml:=<div style=""left: 0px; top: 0px; width: 181px; height: 12px; border-right-color: rgb\(220, 220, 220\); border-left-color: rgb\(220, 220, 220\); border-right-width: 1px; border-left-width: 0px; border-right-style: solid; border-left-style: solid; position: absolute; z-index: 1;"" unselectable=""on""></div>",
"outertext:=",
"role:=",
"title:=",
"type:=",
"visible:=True",
"width:=181",
"x:=414",
"xpath:=//DIV\[@id=""DS""\]/DIV\[1\]/DIV\[1\]/DIV\[1\]/DIV\[4\]/DIV\[1\]",
"y:=510"
++++++++++++++++++++++++++++++++++++++++

I have tried the below code snippet that is working dynamically sometime but each time x-path changed for a particular country showing in the dropdown list and then the code snippet is not working, selecting the different country.

 Set obj = Description.Create()
 obj("micclass").Value = "WebElement"
 obj("html tag").Value = "DIV"
    For i = 0 to strCount-1 
        strPpty = objWE(i).GetROProperty("xpath")
        If strPpty = "//DIV[@id=""DS""]/DIV[1]/DIV[1]/DIV[1]/DIV[35]/DIV[1]" Then
            Browser("QlikView").Page("EMD Plus Analytics_Dev.qvw").WebElement("xpath:="& strPpty &"").Click
            Exit For
        End If
    Next

Please suggest how I can select a particular country from the drop down list.

attaching the screenshot of the application.


Attached Files Image(s)
   
Reply
#2
Solved: 8 Years, 3 Months, 4 Weeks ago
Can anyone solve this problem?
Reply
#3
Solved: 8 Years, 3 Months, 4 Weeks ago
what is the browser and browser version. What is the version of QTP you are using
Reply
#4
Solved: 8 Years, 3 Months, 4 Weeks ago
(04-29-2016, 11:06 AM)vinod123 Wrote: what is the browser and browser version. What is the version of QTP you are using

Replace "United States Of America" with the country which you wan to select from the list of countries.
Code:
xpathValue = "//div[@id='DS']/descendant::div[text()='United States Of America']"

Browser("QlikView").Page("EMD Plus Analytics_Dev.qvw").WebElement("xpath:="& xpathValue &"").Click
If still you are facing issue, then please share the screenshot the object spy by selecting the country
Thanks,
SUpputuri
Reply
#5
Solved: 8 Years, 3 Months, 4 Weeks ago
try using xpath identification as mentioned above
Reply
Jump to the post that solved this thread.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Dropdown Value wahab usman 2 4,057 07-23-2012, 06:16 PM
Last Post: Tarik Sheth
  need help --- for clicking on function its showing error message umaenc 4 3,819 07-19-2012, 11:03 AM
Last Post: umaenc

Forum Jump:


Users browsing this thread: 2 Guest(s)