04-20-2016, 06:35 PM
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.
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.