SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Jun 2003
    Location
    Vietnam
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to check BrowserChild ready or not?

    Dear all
    I call Browser.WaitForReady () to wait the browser ready but sometime Browser is ready but it's BrowserChilds are not ready, I want to click a button on BrowserChild, Error
    SO please tell me the sollution

    Thanks

  2. #2
    Senior Member
    Join Date
    Aug 2003
    Location
    NY
    Posts
    708
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to check BrowserChild ready or not?

    Toan,

    Write your own function, in which you can check if the button is enabled/exists, whichever suits your application. You can pass anytype to the function. Hence this need not be a button always.

    eg.
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[+]customWaitForReady(anytype objControl)
    [+]while(true)
    [+]do
    [+]if !objControl.Exists()
    [ ] RaiseError(2, &quot;Does not exist&quot
    [+]except
    [+] if ExceptNum() != 2
    [ ]break</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">The above uses an infinite loop to check for existence, this could have been as simple as while !objControl.Exists(), but you can add timer to wait for some particular time and/or trials. You can also check for Enabled in the above function. Hence the complications.

    HTH,
    Harshil

  3. #3
    Member
    Join Date
    Apr 2003
    Location
    Fremont, CA, USA
    Posts
    61
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to check BrowserChild ready or not?

    Try BrowserPage.Exists(). Supply a timeout as parameter if necessary.

  4. #4
    SQA Knight
    Join Date
    Sep 2001
    Location
    Bangalore,India
    Posts
    2,549
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to check BrowserChild ready or not?

    Hi,
    For this scenario, you can use button.exists(30) and then you have to click the button. In the exists function, give some more time for that argument.
    Thanks & Regards,
    Palani.
    http://tips-testing.blogspot.com/index.html
    Quote: Donít hesitate to initiate!

  5. #5
    Junior Member
    Join Date
    Jun 2003
    Location
    Vietnam
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to check BrowserChild ready or not?

    Thanks all,
    I call exists () function, but there are some bitmap in Browser Child. Although the page exist, but the bitmap weren't loaded yet. That means browser exist but not be loaded successful
    Are there any solutions?

    Best Regards

  6. #6
    Super Member
    Join Date
    Jul 2003
    Location
    Boulder, CO
    Posts
    1,276
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to check BrowserChild ready or not?

    Query the actual item that you are waiting (bitmap) for in a do-except loop. Here is a sample which waits for an image.

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">while (TRUE)
    [-] do
    [ ] //if (Main.Exists(10))
    [-] if (Main.HttpsImag4.GetTag () != &quot;&quot
    [ ] return TRUE
    [-] else
    [ ] catchmaintries++
    [-] if (catchmaintries &lt; 4)
    [ ] sleep (5)
    [-] do
    [ ] Alert.SetActive ()
    [ ] Alert.OK.TypeKeys(&quot;&lt;Enter&gt;&quot
    [ ] sleep (2)
    [-] except
    [ ]
    [ ] continue
    [-] else
    [ ] return FALSE
    [-] except
    [ ] </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">This is more complicated than what you need probably, because I am trying to stimulate the appearance of the image if it isn't there (Alert stuff).
    Chris R Mead

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:21 PM.

Copyright BetaSoft Inc.