Forum Discussion
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;
}
Or you can use the title of the grid as anchor:
.//h4[text()="Basic Example"]/following::div[1]
- baxatob6 years agoCommunity Hero
You can test your xpath directly in your browser (e.g. using developer tools). If it works there, it will work also with TestComplete.
- vijaysimha6 years agoOccasional Contributor
Please illustrate an example on how to write dynamic xpaths in Testcomplete tool.
Ex: //*[@id='signout']/div[1]
- vijaysimha6 years agoOccasional Contributor
Please illustrate an example on how to write dynamic xpaths as we use to write in Eclipse as ByXpath("//*[@id='signout']/div[1]") and if possible please make a video.
Ex: //*[@id='signout']/div[1]
Related Content
Recent Discussions
- 3 hours agojstaehlin
- 20 hours agoAivanitskiy
- 24 hours agonastester