Jump to content

WebDriver : Check web reload (_WD_GetSource VS PixelChecksum)


Recommended Posts

I have a problem on _WD_GetSource that it's too fast to retrieve source before the web page complete reload.

I found that we can use _WD_LoadWait to check complete before continue.

By the way, the web page that I need to retrieve source has reload by script inside that mean _WD_LoadWait cannot detect that it under loading.

So I have 2 idea to solve this issue by

1. Use _WD_GetSource and compare with last "Source" before reload, when found any change will continue.

2.Use PixelChecksum to check any area on web page (I expect to found any change once load complete), when found change then continue.

So I need suggestion that which idea could get result better and also better speed. Can anyone advise on this.

If there are any function or idea that could better than please suggest also.

Link to comment
Share on other sites

11 hours ago, maninternet said:

By the way, the web page that I need to retrieve source has reload by script inside that mean _WD_LoadWait cannot detect that it under loading.

Would using the optional $sElement parameter help in this situation? Can you share the website URL?

10 hours ago, maninternet said:

Use PixelChecksum to check any area on web page

This should only be used as a last resort in my opinion. Have you checked out the function _WD_WaitElement?

 

Link to comment
Share on other sites

  • 2 weeks later...

Sorry I didn't back to reply until now.

Since the website that I target to read the source need login and it's contain my some personal information. So I cannot share the source to you.

By the way, I have try myself on both method. I have found the best way to add sleep(70) after the reload button was clicked. So it's the fastest and reliable way.

 

I have one more question, Can we reduce the time use for _WD_Getsource()? This's now bottle neck of my script.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...