cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Dynamic Path element for a changing web app/site

AmithRajagopal
Level 4
Hi Everyone,    Good day! Few months back i have automated a web page where i selected all path attributes while spying the elements for better performance(as you know without it, its too slow to get the work done even if Index/ordinals are selected). But now the  web page build slightly changed and due to the introduction of extra button or labels at the top of the page , the numbers in path attribute changed (like before it was HTML/DIV(2)/FRAME(3) and now it is HTML/DIV(2)/FRAME(4)). and in some places it has reduced.  I was researching on this here in this BP community and came to know that we can solve this by using dynamic option. But i am confused on how to do it ?. As we are not aware like how the numbers are going to change , it can increase or decrease. If we know how the path element is behaving , we can put the value as dynamic and change the element value. My concern is that this change will work now but when there is another build change, again its going to change the path attributes numbers and again we should change the numbers.  Another option i saw suggested by John was to read a near by elements path and use it for the other elements . I think this should work . But how we can say that if the near by element's path will be similar to the  one we need .    Can anyone suggest a way to overcome this problem ? I dont have any issue with HTML Path when i open the web page any repeated times , but the problem is when the web page developers deploy a new build and the path elements gets shifted unpredictably.   Best Regards, ARG
3 REPLIES 3

AndreyKudinov
Level 10
If by dynamic path you mean wildcards in path - it is extremely slow if works at all (has anyone got it working decently?). You can rewrite path to find nearby element (like rpachallenge.com), but there is nothing dynamic in it and it won't help your case much. At best, you can set up one (few) variables with beginning of the path that you can change once for all your elements. Unique tag+id is the best option imo. I avoid using path unless absolutely necessary (element has shifting/blank id). 

AmiBarrett
Level 12
If you know of a reliable range/pattern that it can display as, you can absolutely do a Dynamic option. Once the element is set to dynamic, the value for it in the Application Modeler should be greyed out and will be considered NULL. On your read/write stage, after you've added it to the list of steps, there should be a little button on that same row with three dots. In here, you can feed it the path you want to check.   We ran into a similar issue on the newer web version of BMC Remedy, where a random seed was generated at login and would define the div offsets for the page we needed. I wound up having a divNumber data item, then checked if the element I was looking for existed via a quick wait stage. If it did not, I'd bump up the div number by one and try again, up through a specific predefined range. If it still couldn't find it, it'd throw an exception. So it should look something like this (where frameElement is whatever you've called the spied item in Application Modeler): Number - divNumber - 1 Text - divPath - ""HTML/DIV(2)/FRAME(""&[divNumber]&"")"" Wait - frameElement - Value, divPath - checkExists, True False - Calculation - divNumber = divNumber+1 Wait stage Rinse, repeat If not found, exception True - Move on

AmithRajagopal
Level 4
Thanks Everyone. I am trying the readng path attribute of a near by element on page load and compare its path with other elements path when the element is not found. Will update if its working