A tag in different sub tab

I have a web[page, where I have few sub tabs and each tab has table. I am trying to click edit link in particular cell. When I try to click edit link in 1st subtab, it works. but similarly I try to click edit in 2nd subtab, it doesnt work.PLease help.


Below is my script view

2018-03-15_0009.png

2018-03-15_0011.png

Does anyone respond to question here at all? Or i am missing something?

Let me see if I can help…

When you say “this one works - this one doesn’t” what exactly happens? Is there an error? Did you code the xpath yourself or did you record it? Is the tab (and its table) visible when you click the Edit link?

You see, we’re not mind readers and although your page and your code might look very familiar and obvious to you, it’s not obvious to us (as strangers) looking at it what might or might not be going on. Try to offer as MUCH info as you can, then you’ll find someone is able to help you better.

Russ

Hi Russ, thank you for replying. I really appreciate it. Basically my purpose is to open the last record my automation script just created dynamically. So when I create a record, it goes to next tab(in this case its (QC review) and then I have to sort it desc to see last record on top and click the enter of first record. I did go through handling web tables in katalon Q& A but did not work for me. Please let me know what else I can provide you.
Below is some info: below is the page where I am trying to achieve same thing.

I was able to go to next tab and also through pagination, I was able to go to last page. Now my script always fails when I am trying to capture the last enter in that screenshot.
another screenshot of the object that keeps failin on step 31.

below is my script. Please let me know.

qna.png

object_failing.png

myscript.txt

I’m not an xpath guru but it looks to me like that xpath is messed up.

If you want to click one of those “Enter” buttons which I think are anchor tags () then I would use CSS and use this as a starting point:

#DesignDocumentListGrid tr:nth-child(N) td:last-child a

Change the “N” to match the row number you want to target.

And understand this: picking through your message and your images is not easy - the code I gave you could easily be wrong.

Hope it helps.

That is my main concern, I dont want to pass N staticly. I want my script to figure out what N is? do you think there is a way for me? if not, I am trying to sort by clicking on Action link, which will sort desc for me. it always gives me element not found.

sort.png

action_link.png

I now have a strong suspicion what’s going on…

The moment you reorder your table, you’ve destroyed your TestObject references. Broadly speaking, there are only two ways to reorder a layout like that, and both involve trashing (in effect) your original HTML tr/td elements and rebuilding them. This is not anything YOU are causing – it’s how the DOM behaves when reordering table rows (and pretty much anything else that seems to “move” on a web page).

You’ll need to change your approach and use dynamic test objects where you assign the references inline in your tests.

Firstly, read and understand this: https://docs.katalon.com/display/KD/[WebUI]+Modify+Object+Property

Then take a look at this thread, it will hopefully help you get started: http://forum.katalon.com/discussion/comment/13340/

Hope that helps.

Russ

Hi Russ, I think i tried Modifyobject property like you mentined above but still wont work for me. I do have one more question while I try to figure out what I am missing on using modifyobject property. I am having hard time dealing with kendo dropdown/unordered list/bootstrap dropdows.
I have tried so many different ways to select a value in bootstrap dropdown/unordered list/kend dropdown. I also posted on so many related topics in forum. but I am not getting any response.
I used below lines and it worked to select 1 dropdown value.

WebUI.waitForJQueryLoad(30)

(DriverFactory.getWebDriver() as JavascriptExecutor).executeScript(‘$(“#Submittal_SegmentId”).data(“kendoDropDownList”).select(1);’)

But when I try to use the same lines for all other 5 dropdowns on the page, its failing.If I have 15 kendo dropdowns on the page do I need this statement [ WebUI.waitForJQueryLoad(30) ] before each dropdown select?
_I keep getting error “Cannot read property ‘select’ of undefined”. I have like 4 dropdowns to select and I used above technique but doesnt work for me. What am I doing wrong? PLease help. here is the screenshot.
Can you please help me? _

2018-04-23_1030.png

I have tried so many different ways to select a value in bootstrap
dropdown/unordered list/kend dropdown. I also posted on so many related
topics in forum. but I am not getting any response.

Imagine there are, say, 200 people reading your questions – do you want them all to respond saying “Sorry, I don’t know.” ? A lack of response just means people don’t know what to say or how best to advise you: which is the position I’m in right now.

I’ve given you a couple of links to get you started. You should read them and try to implement something that you know works. If you are struggling to get something RELATED to those links working, post questions.

What you have is a quite complex and dynamic page. It might seem daunting at first but remember this: “it’s just HTML” and it’s not a moving target. And neither is Katalon Groovy code. It can be mastered and tamed to perform to your liking. But it takes time. Don’t “move on” until you have mastered one of those dropdowns and be sure to know WHY your code is working. Then, when you adapt that code to work with another instance of the dropdown, you should understand immediately why it’s not working in the new situation.

That’s the best generic advice I can give you. Perhaps someone else reading this knows the Kendo components quite well and can see what your issue is, and maybe they’ll chime in. But don’t assume a lack of response is anything other than, “Sorry, I don’t know.”

Russ

Hi Russ, I agree with you. But I read all the possible dropdown post in katalon forums and none of them seemed to work. While I understand what you are saying, I wanted to check if you know what can be wrong with the screenshot error I posted. When I have tried and tried for enough days and cant understand whats goign on. why same line of code gives error for one dropdown and works for another, then I am asking here. I wanted to share here and get another eye on it in case I am not able to see anything obvious. Anyway thank you for your response.

Okay… let’s try this:

Go to that same page in your browser. Take one of those PINK lines from your test, for example:

$("#Submittal_SegmentId").data("kendoDropDownList").select(1)

Now paste it into the browser console (F12 Developer tools). If you’re using Firefox, you may need to type “allow pasting” first.

Does that do what you think it does? does …select(3) work?

Russ Thomas said:

Okay… let’s try this:

Go to that same page in your browser. Take one of those PINK lines from your test, for example:

$("#Submittal_SegmentId").data("kendoDropDownList").select(1)

Now paste it into the browser console (F12 Developer tools). If you’re using Firefox, you may need to type “allow pasting” first.

Does that do what you think it does? does …select(3) work?

Yes, works if I do this in devtools.it selects correct value. $("#Submittal_SegmentId").data(“kendoDropDownList”).select(3)

So which line is failing?

Do the contents of the dropdowns change as you proceed to make selections?

This line keeps giving error “can not read “Select” property of undefined… (DriverFactory.getWebDriver() as JavascriptExecutor).executeScript(’$(”#Comment_ReviewTypeId_0_").data(“kendoDropDownList”).select(3);’)

And the answer to my second question is?

the contents of the dropdowns DOES NOT change when I run the script but when I use dev tools to do the selection, it does change $("#Submittal_SegmentId").data(“kendoDropDownList”).select(3)

These jQuery commands work to trigger the dropdowns in the console:

$("#Feedback_Comment_ReviewTypeId_0_ .k-widget").click()
$("#Feedback_Comment_ReviewerId_0_ .k-widget").click()

Now all you need to do is use those in your tests using JavaScript calls when you think jQuery is ready and available on the page.

Once you have those working, you should be good to deal with any Kendo dropdown.

it worked, thanks a bunch