Application Modeler: Match Type Dynamic for Enabled attribute

ebueno

New Member
Team

I'm trying to find how to evaluate if a field in a web browser is "enabled" or "disabled" for clicking on it and do an action. As you probably know, when you have more pages to check a table, you usually has a sort of "Next Page" link at bottom which is always enabled if you are in the 1st page, 2nd page, etc BUT IT IS DISABLED when you are in the LAST PAGE of the table, in order to avoid "more clicks" on that field.

I'm trying to resolve, HOW TO EVALUATE if that field has "enabled" or not related HTML attribute. I'm using MATCH TYPE = "dynamic" for the ENABLED attribute. But when I try go get the value using a READ stage, I'm receiving the following error message .... "Identifier false of type html not found"

Can someone lend me a hand?. Thanks in advance
read stage.jpgread stage.jpg
 

VJR

Well-Known Member
Hi ebueno,

In the Inputs section at the bottom of the Reader stage provide the Attribute Name as "Enabled".
 

ebueno

New Member
Hi ebueno,

In the Inputs section at the bottom of the Reader stage provide the Attribute Name as "Enabled".
Thanks VJR for your quick response.

I've made the update as you proposed, but unfortunately it doesn't work, showing me the following message "READ: 'Reader1' Process: 'Ver Next Page' Subsheet: 'Ver Next' ERROR: Internal : Failed to perform step 1 in Read Stage 'Reader1' on page 'Ver Next' - No elements match the supplied query terms".
Let me try to sum up what I have.

1.- In the application modeller, I've spy a HTML element named "Click Next", which has associated the action to junp to the next page (bearing in mind that the there are still rows to be showed in tha web table)
2.- This element is ENABLED in the 1st and following web pages, till the last one on which it's changed as DISABLED (grey colour) with no action associated, because there are no more rows to show.
3.- This HTML element has associated two attributes.
  • "PATH", with "match type" = to the associated HTML path
  • "ENABLED" with "match type" as dynamic with value "true"
4.- READ stage has as action the following:
  • Element "Click Next"
  • Parameters " ENABLED Flag = True"
  • Data "GET HTML Attributes"
  • Data Type "Text"
  • Store In "Enabled Attributes"

And following your suggestion, I've the following at the INPUTS section
  • Name "Attribute Name"
  • Datatype "Text"
  • Value "Enabled"

So what is wrong here?

Thanks again for your insight and time.
 

VJR

Well-Known Member
Hi ebueno,

To try to mimic your situation I am spying the Next button on the following webpage.
https://datatables.net/

When I make the same changes as in your Point #4, I get the result as True in the data item as shown below
1529232710158.png
1529232837103.png
1529232809930.png

But when I run this same process when the webpage is on the 6th page where the Next button is disabled then I get the same error as yours - "No elements match the supplied query terms" which is correct because the Next button is not Enabled=true on the 6th page and BP won't find a matching element.
Do check if this is the case happening with you.
 
Last edited:

ebueno

New Member
Hi ebueno,

To try to mimic your situation I am spying the Next button on the following webpage.
https://datatables.net/

When I make the same changes as in your Point #4, I get the result as True in the data item as shown below
View attachment 1124
View attachment 1126
View attachment 1125

But when I run this same process when the webpage is on the 6th page where the Next button is disabled then I get the same error as yours - "No elements match the supplied query terms" which is correct because the Next button is not Enabled=true on the 6th page and BP won't find a matching element.
Do check if this is the case happening with you.

Hi VJR, thanks again for your time and prompt reply. You definitely gave me the clue.

I get now the solution. I've spying "datatables" web site but using HTML spy mode, where I found that in both cases ... pages 1, 2, 3, etc and page 6 (the last one with "Next" link disabled ... attribute ENABLED does not vary. That is, it's always = TRUE.

So having in mind this situation, I was looking for another attribute which help me to differentiate between both statuses and I've found that attribute "CLASS NAME" has the solution.

Using a READ Stage, when you are on page 1, 2, 3, etc, the value for this attribute is "paginate_button next" ...but when you are in the 6th page its value is "paginate_button next disabled". So you only have to read such attribute (GET HTML Attribute), store it in a text variable and check for "disabled" string using the following InStr([Enabled Attribute]; "disabled")>0.

If the response is TRUE, then you are in the last page. Otherwise you can "click" on the associated element to move to the next page. By the way, you don't need to check this "CLASS NAME" attribute in the Application Modeller, such read the content when needed (ie. not required dynamic setup).

So now this thread can be closed. Thanks again

So the t
 

Attachments

  • application modeller.jpg
    application modeller.jpg
    47 KB · Views: 80
  • process.jpg
    process.jpg
    28.4 KB · Views: 82
  • reader.jpg
    reader.jpg
    44.6 KB · Views: 81

VIPUL ARORA

New Member
In this case reader stage copy only like in one data data is stored in collection from 1-50 after entering the reader stage value store 51-100 old data is overritten
 
Top