Forum Discussion
See attached. I have marked the matching pairs of quotes in blue and the mismatched one in red.
You need another single quote to match the one marked in red. I believe it needs to go here
id='150952
Thanks Marsha. Still have the same issue
var obj = Sys.Browser("*").Page("*").FindChildByXPath(".//*[@id='150952'" + * + "'-grid-container']/div[2]/div]");
- baxatob7 years agoCommunity Hero
Hi,
XPath won't recognize "*" as a wildcard.
You should use another approach. E.g. using the contains() function:
.//div[contains(@id, "150952") and contains(@id, "grid-container")]
- AlexKaras7 years agoChampion Level 3
Hi,
As a side note: https://community.smartbear.com/t5/TestComplete-Functional-Web/Using-Xpath-in-TestComplete/m-p/151235#M30757
- muhammadA7 years agoOccasional Contributor
I am trying to
Url: http://ui-grid.info/
Angualr UI grid
I am trying to get the values of the upper grid. I need to capture those values from the table and verify them with the values in Excel sheet in Test complete.
I used all the three types of finding the object,none of them worked. Please verify following script and let me know where I am going wrong.
Thank you for co operation in advance
function VerifyGridValue(textValue)
{
Sys.Browser("*").Page("*").Wait("10000");
var obj = Sys.Browser("*").Page("*").FindChildByXPath(".//*[@id='150952'" + * + "'-grid-container']/div[2]/div]");
//Sys.Browser("*").Page("*").FindChildByXPath("//*[@class='" + ui-grid-canvas + "']")
//var obj = Sys.Browser("*").Page("*").FindChildByXPath(".//*div[contains(@id, "150952") and contains(@id, "grid-container")]/div[2]/div]");
var val=obj.wValue(0,1);
switch (true)
{
case IsSupported(obj, val) == true && textValue :
Log.Checkpoint("Value match as expected");
break;
default:
Log.Error("Text values do not match!");
}
Log.CallStackSettings;
}
Related Content
Recent Discussions
- 12 hours agovladd1