How to add wait / Delay until web page is fully loaded in Automation Anywhere? - webautomation

I want to know 'How to add wait or Delay until webpage is fully loaded,' in automations anywhere,
I used
wait for screen change
But it hold the process until some time specified by the developer , but I want to add delay until the web page fully loaded,
Is there anyone can help me?
sorry for the bad English.

Usually, a website is "loaded" or "ready" before the actual content is loaded. Some websites even have dummy content which is replaced once the actual content is retrieved from 'somewhere'. Hence waiting for the screen to change is not a good idea.
My approach is to pick an element which you know is loaded after the element you want to interact with. For instance the navigation bar on this website is loaded before the comments are. You can either figure out which element to use by looking at the source of the website by right-clicking anywhere and selecting view source or by simply refreshing the page a couple of times and eye-balling it. The former requires some HTML knowledge, but is a better approach in my opinion.
Once you've identified your element, use Object Cloning on said element and use the built-in wait as a delay (usually set to 15 sec, depending on the website/connection). The Action should be some random get property (store whatever you retrieve in some dummy variable as we're not going to use it anyway).
Object Cloning's wait function polls every so many milliseconds and once the element is found it will almost instantaneously go to the next line in the code. This is where you interact with your target element.
This way you know your target element is loaded and the code is very optimized and robust.
On a final note: It's usually a good idea to surround this with some exception handling as automating websites is prone to errors.

A very simple solution is to run your automation while watching and determine the amount of time it takes for the webpage to load. You can add a Delay rather than a wait if you know the page is generally loaded within 30 seconds or so.

Related

AEM: Access component rendition only, not the whole page containing it

I have a component that performs pagination with its suffix.
So,
/contents/myproject/search.html/1 brings the first page displaying 10 results
/contents/myproject/search.html/2 brings the second page displaying 10 different results
Now I've been asked to make it more dynamic and add a next button to page 1, so it will append the next 10 results, instead of having another separate page load.
My plan is to use JS and make an AJAX call to the following page, find the div I want, take those 10 results and append them to my first 10. The issue is that page is enormous and I would be downloading a lot of other unnecessary stuff in that call.
Is it possible to access the rendered component only? the one being added by
<cq:include path="pagination" resourceType="myproject/components/pagination" />
If you have node pagination under /contents/myproject/search/jcr:content with correct sling:resourceType, then it should be pretty easy - GET request to /contents/myproject/search/jcr:content/pagination.html.
Also it highly depends on implementation of this component if suffix will work there.

Content merging AEM

We're looking for a solution on how to best deal with the situation where multiple authors are working on the same page. If the first author pushes in the content, the second should have a way to merge it when he tries to publish. Launches appears to be a way to take care of this but it doesn't seem to be handling content merging. Is there any way an author can view the diff(and or do merge) of the content that might have been pushed by another author while they were working concurrently ?
Please help with any pointers.
Page modifications happen in real time to the underlying structure. They also happen at as small a level as possible.i.e. If you go into a text area and modify the text there, the text node is changed on the server, you aren't saving the entire page.
The only way that person A could interfere with what person B is doing is if they were working on the exact same area of the page. Which, honestly is a process issue. I say this because the answer to your question is that there is nothing out of the box to handle this type of scenario and if you are on 6.0 or higher and looking at the JCR3. JCR3 handles this far worse than the older version did. Last time I checked it didn't support nodes at all
Adding to what Bailey said, AEM OOB allow multiple users to edit same page in real time, though if multiple users are working on same node will be a reason of conflict. Such cases can be managed by defining a process like:
1. Take a lock of page and edit page or
2. Create versions of page and publish versions

How to refresh parts of page when database changes?

I want a better way to update images on a webpage instead of forcing the webpage to refresh every 60 seconds.
I wrote a little status page that monitors some of our web sites. It uses web.py and displays a list of servers I have inputted into a database.
Each server that is up gets a Green png image displayed next to it.
When a server goes down I update the status in a local mysql database to false.
The next time the page refreshes it gets a red png displayed next to it.
Right now that red png file does not display until I refresh the page.
Is there a way in web.py (python) that I can make just that image dynamic without having to refresh the whole page? Or do I have to use something else to make it work?
Well, the generic answer is that you use AJAX and put a script on each server that will return "up" or something every time your page checks.
Here's a tutorial on how to do AJAX with web.py specifically: http://kooneiform.wordpress.com/2010/02/28/python-and-ajax-for-beginners-with-webpy-and-jquery/
I have no knowledge related to web.py.
But in my point of view what you gonna need is to break your code in two parts (a monitor service and a monitor display) and use javascript to asynchronously update the data.
Your monitor service will provide a url that receives the monitored site ID and returns up or down. As you are using web.py, it will probably be 100% python.
Your monitor display will use javascript to ever X seconds checks that url and show the correct icon. It can be python based, or not. But it will need javascript.

I want to be able to search an html page that is refreshing every 10 seconds for the word "stat"

I want to be able to search an html page that is refreshing every 10 seconds for the word "stat". If the word is found I then want to alert the user through a pop up dialog and possibly a repeating sound until the user acknowledges it.
UPDATE:
Sorry the question was a bit ambiguous. I do not know a great deal about this stuff I just do it as a hobby.
OK so here is the deal. I work as Biomedical Electronics Technician for a hospital. We have a work order system that is web based. Nurses can enter a work order into this system. I have a browser window open at all times that refreshes periodically through an add-on for IE so I can always be up to date on the status of the work orders coming in. When a nurse the enters enters a work order they have the option of choosing Stat, High, Medium, or Low for the priority. When a stat work order is placed our response time should be within five minutes theoretically. I want some way to alert myself when a stat work order has been placed so I can respond accordingly. And I know a repeating sound would be annoying, but that might be the best way to get my attention.
Another caveat to this is the work order status can be changed by me, the tech. So when a work order is initially placed the status is Not assigned or something like that. Once I go start on a work order I change the status to In Progress. If I have to order a part I change the status to Hold for Parts, etc. So basically, what I am saying is I don't want to alerted if the status is anything but "Not assigned". If it will help I will get a copy of the source of the page when I get to work tomorrow.
Our IT department seems unwilling to help and the company that made the product is so busy chasing the daily bugs that show up to add new features such as this at this time. If I knew more a Google search might help, but alas I am a bit noobish in the programming realm, however I am 2 years from a C.S. degree so I am not a complete novice.
To answer another question, I do not have access to the page I am just viewing it so any sort of script would need to run on my client machine.
Thanks
I found this, try it https://addons.mozilla.org/en-US/firefox/addon/3028/
Maybe it can search for STAT on the entire page?
Based off your description, it doesn't sound like you have access to the server to change the code of the page itself, correct?
If that's the case, spend some time learning how to use Greasemonkey (or rather Greasemonkey for IE). It allows you to add functionality to a web page from the client (browser) side, regardless of what's on the server.
You'll need to find the elements that hold the "stat" term your after, and have it check periodically those elements periodically. Look into the setTimeout method for that periodicity. The rest you'll have to work out specific to that page.
What you're looking for, since you have python available, is to build a simple, easy to use webscraper.
First link is how i would do it quick and dirty.
http://www.ehow.com/how_4436125_read-web-page-using-python.html
Second link is a bit more robust and nifty with BeautifulSoup
http://www.builderau.com.au/program/python/soa/Build-a-basic-Web-scraper-in-Python/0,2000064084,339281476,00.htm
Basically, read the page (even set the whole loop on a 10 second refresh timer).
Go line by line with a while readline loop.
See if one of your magic words exists with a regular expression
...
profit?
(... meaning do your alert song and dance)
(profit being rejoice!)

iPhone SDK: Ideas on how to implement a help facility for application

We we wondering what are some ways developers have added a help function to their apps. What are some techniques people have used?
One way we were thinking of is to us UIWebView to display a HTML file with help instructions.
Thoughts appreciated.
I'm using UIWebView right now which pretty much contains all the help in a single page, along with some JQuery things to display popups, etc. But I like the way iCab Mobile (et al.) are doing things which is a sectioned UITableView with each row a separate topic or section within their overall help information (complete with icons...) then in their bundle they have each section in its own html file, organized by localization.
Another thing in my queue for the next release is to provide a dynamic "News" view. The rough idea is as follows... I have on my server a file or CGI where I can place small bits of news I'd like to push out to users. On startup, my app checks for network availability and if present, start a thread to see if anything has changed on the server since last updating the News data. If changes present, post an alert letting user know, and asking if they'd like to read it now. At that point, the latest news is already downloaded and cached, so they can simply read it later if they want, and I won't post anymore alerts until the server file changes again. (And one could add a preference/setting to disable these alerts.)
I'm thinking this would be a good way to let people know that some nasty bug is known and fixed and an update is sitting in the queue, solicit beta testers, promote upcoming features or other apps, etc. I can see where constant alerts everytime I've got something new to promote would get annoying, so having a setting to disable them means the user never has to read them unless they want to. Although some kind of override to warn of recently discovered/fixed bugs seems sensible.
FWIW, the author of Mover+/Mover has just started doing a similar thing, though I think Emanuele is perhaps only showing one Notelet at a time, whereas I envision a bit more of a history (shown in UIWebView) until I decide to age stuff off the bottom of the stack.
I'm using a scroll/page view to show several images containing small notes. Each image then tells the user about the more advanced functions on a specific part of the app.
In my opinion the help should only contain information that isn't a 100% relevant for the use of the application. It should be things the advanced user should use to make more use of the app. It should contain gold for the power users. The "basics" should be so obvious that no help would ever be needed. If that's not the case, I think, you've failed as a developer on the iPhone platform.
(Here's a screen shot from my demo app)
I'm currently creating a fairly complicated app. I'm thinking of doing help as a semi-transparent overlay - help in text form is hard to swallow for users; it's much more helpful to just point at stuff and say "this does that".