Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Questions: Get element from another domain, load page without blocking

View previous topic View next topic Go down

Questions: Get element from another domain, load page without blocking

Post by orestis125 on Tue Sep 25, 2012 4:13 am

Heya everyone,

I'm new to this forum so please forgive me if I'm posting this in the wrong place. I've recently started working with the selenium web driver in java and I have a couple of questions for which I can't seem to find any answer on the web.

My first question is whether there is a way to get an element (Specifically by xpath) of a page from another domain. For example the browser's current URL is "google.com" and I need to get an element from "yahoo.com" without navigating to yahoo. If this is possible, how will I do that? If there is no direct way of doing this, is it possible to invisibly create a new web driver? For example if I can create a web driver and navigate to "yahoo.com" with an invisible browser I would be able to achieve this.

My second question is whether there is a way to stop blocking the program when the browser loads a page. Currently my program freezes until the page finishes loading. I've tried using threads but that results in other problems. If it's possible, how will I achieve this?

I would greatly appreciate it if someone could help me out and provide me with some information

Thank you very much,
Orestis

orestis125

Posts : 3
Join date : 2012-09-25

Back to top Go down

Re: Questions: Get element from another domain, load page without blocking

Post by popsha on Tue Sep 25, 2012 8:26 am

Hi Orestis

Answer 1:

Cannot find the xpath of an element without navigating to specified webpage. But, can use HtmlUnitDriver to instantiate webdriver invisibly and fast. Use below link for further reference
http://seleniumhq.org/docs/03_webdriver.html#htmlunit-driver

Answer 2:
Use implicit wait option for page loading. Often usage of threads lead to weak design of framework.

popsha
Amateur
Amateur

Posts : 60
Join date : 2012-04-14

Back to top Go down

Re: Questions: Get element from another domain, load page without blocking

Post by orestis125 on Wed Sep 26, 2012 7:30 pm

Thank you for your reply,

Everything works perfectly now thanks to your suggestions. However I've noticed that HtmlUnitDriver is extremely slow (takes about 20 seconds to fully load a page) compared to my FirefoxDriver.

Any idea what might be causing this? Is there a way to speed it up? (Maybe a way to disable the loading of images or stop loading page when specific element has been found)

Thank you very much for your help,
I greatly appreciate it

Orestis

Edit: Also, I know they are just warnings, but I keep getting "WARNING: Obsolete content type encountered" and similar messages. Is there a way to disable them? Makes it harder to debug using the console window.

orestis125

Posts : 3
Join date : 2012-09-25

Back to top Go down

Re: Questions: Get element from another domain, load page without blocking

Post by popsha on Thu Sep 27, 2012 1:26 pm

Hi Orestis, thanks for your appreciation.

FirefoxDriver is the fastest comparable to others, speeding up it, results in vain. Since WebDriver rely on native events, it is not possible to speed up loading time.In your scenario, only reducing the loading time in application would help you.

Obsolete content type encountered - occurs in HtmlUnitDriver execution which is least bothered as it comes in recent versions.

My suggestion is that, Use isDisplayed() in try-catch block for the web element you search and skip to required event.

popsha
Amateur
Amateur

Posts : 60
Join date : 2012-04-14

Back to top Go down

Re: Questions: Get element from another domain, load page without blocking

Post by Sponsored content Today at 7:12 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum