Question
Bank of America
US
Last activity: 27 Sep 2017 20:33 EDT
Page navigate method fails, inconsistently.
I have a web application project which require to navigate 100's of webpage and scrape data. Looks like at some point the htmldocument become null and unable to set url for navigate, even though the match rule satisfy.
Example:
www.abcdefg.com/data/form=1, www.abcdefg.com/data/form=2,www.abcdefg.com/data/form=3.
So i have three webpages to navigate and get data. I have interrogated the first page and supplied further url to webpage with Navigate method. The match rule I provide as webpage host, so I was expecting the webpage should match and proceed. Looks like after 10 or 15th iteration I am getting error that HTMLDocument is null. I do follow the wait for create true path. But still on navigate, it fails.
Appreciate any tips and tricks.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
US
If your web page navigates to itself (based on your match rules they are all the same page) you must first wait for the page to be destroyed before waiting for it to be created. When you execute the navigate the page is created and your isCreated test is probably taking place before it is destroyed. Your automation should look like this (add appropriate error handling for the fail situations).
Pegasystems Inc.
US
Another way to navigate a web adapter is to interrogate the web browser control. This may cause other problems, but in my experience, it has been reliable. To interrogate, you'll need to do the following;
- Update the IgnoreMainBrowser property on the adapter to False.
- Start Interrogation.
- Navigate to a web page that you have not interrogated.
- Uncheck Create Global Webpage from the Interrogation form.
- Interrogate some control on the page.
- You should see a new hierarchy in your adapter.
- Delete all controls below the WebBrowser control.
- Update any match rules for controls in this hierarchy so that they match any page you might navigate to.
- Generally, you can just delete any Text Match Rules.
- This control has a Navigate method that you can use on any page to Navigate the browser.
Bank of America
US
Thank you. Sounds interesting.. I will give a try now.
Bank of America
US
I tried this. the problem is after page navigation the control is not matching. Even thought match rules are satisfying with same url on interrogation mode.
Pegasystems Inc.
US
That would indicate that you have not made the match rules on the WebBrowser control or its parent controls generic. As Thomas mentioned, make sure that you remove any Text based Match Rules. Navigate by hand to each page and your WebBrowser should remain matched. If not, check the first control in the hierarchy that does not match - that will be the one that needs its Match Rule to be fixed.
Bank of America
US
Hi Jeff,
with the second run it succeeded. After the latest windows update I do see lot of issue with internet explorer.
Automation which I was running without any issue started giving me issue with browser, saying its not created, even thought the iscreated method succeed or return true.
thanks
Sameer
-
Sumit Malik
Accepted Solution
Pegasystems Inc.
US
If your web page navigates to itself (based on your match rules they are all the same page) you must first wait for the page to be destroyed before waiting for it to be created. When you execute the navigate the page is created and your isCreated test is probably taking place before it is destroyed. Your automation should look like this (add appropriate error handling for the fail situations).
Bank of America
US
Thank you Jeff.