dynamic table values
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
dynamic table values
Hello everybody!
I would like to ask you what is the best way for coding a function in Java script for choosing (click) a value into a dynamic table?
Thank you for helping me in advance.
Best regards
lambada
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Try to use the approach, described here: https://community.smartbear.com/t5/TestComplete-General-Discussions/How-to-select-the-a-check-box-in...
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you I will try. So I don´t need to write a loop?
And I don´t need the "parent" as in this example.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This approach is working without loop.
Usage of Parent property depends on hierarchy of elements on your page. Analyze it using ObjectBrowser data.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem is, that the RowIndex changes! For example: if I create Anna0, the RowIndex of Anna3 will after that be RowIndex=4. Bevore the creation of Anna0, the RowIndex of Anna3 was 3.
So I think there I need a loop that will "count" and go step by step through the table and search "Anna3" for clicking on Anna3.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Let it changes. Just call required object (Anna3) after the new one (Anna0) was created.
If your main action is just to click directly on element Anna3, you can still do it using Find() method. Something like:
Aliases.yourPage.Find("contentText", "Anna3", 10).Click()
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, I will try.
And what control you recommend for opening number 3 (the blue box)? It should click on number 3 first bevore the table with Anna´s opens.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't know, while you have not provided us with the source code of this page or the ObjectBrowser data. 🙂
Also you can use Object Spy to find required control and check its properties.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi baxatob
Unfortunately
var url = "https://.........";
var page = Sys.Browser("chrome").Page(url);
...
Aliases.page.Find("Anna3", "Anna3", 10).Click(); was not working.
Aliases.yourPage.Find("contentText", "Anna3", 10).Click()
Are there any other methods?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@lambada wrote:
Aliases.page.Find("Anna3", "Anna3", 10).Click(); was not working
There are two possible issues:
1) You have assigned a page variable and then used it with Aliases. If you want use Aliases, you need to map your elements into the NameMapping repository. Otherwise you should call only page.Find(...)
2) Find("Anna3", "Anna3", 10) - will not work ever, because the first argument should be the object property. Most probably it's a contentText, but better if you will check it using Object Browser.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, thank you. I will change page.Find(...);
I looked up the contentText with object spy, and the value was also Anna3.
