Search
 
 

Display results as :
 


Rechercher Advanced Search

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Selenium and PhantomJS code examples that use directory path as opposed to using a URL

View previous topic View next topic Go down

Selenium and PhantomJS code examples that use directory path as opposed to using a URL

Post by cslewis56 on Fri Feb 27, 2015 1:39 pm

Here are the details of my Development Environment:
•Visual Studio 2012 Ultimate with Update 4
•Google Chrome Version 38.0.2125.111 m
•Selenium Chrome Driver Win 32 2.12
•Windows 7 Professional with 32-bit Operating System
•Phantom JS 1.9.8
•NUnit 2.6.3
One of our Customers wanted us to create Test Harness Webpages that we can use to test various UI components of our web application.
The Test Harness should be Simple Webpage where we can test the ViewPanel of the web application or the Footer for the Web application.
It's the components like the ViewPanel or the footer that could be complex, but the Test Harness WebPage should be simple. Think of the Test Harness as an Isolated Science Laboratory area. We could have a Test Harness dedicated to testing a ViewPanel of the web application. Another Test Harness dedicated to testing a Footer of the web application.
In our Test Harness Webpage design, we load the "UI component Under Test" into the Test Harness Webpage by specifying the directory path ( relative path or absolute path ) that leads to the "UI component Under Test"
For example, our Test Harness Webpage code will specify a directory path ( relative path or absolute path ) like the following:
Code:
D:\WrkSpce\BlahBlahApplicationProjectBlahBlah\MainSection\BlahBlahSidePanelBlahBlah.aspx

or

\MainSection\BlahBlahFooterBlahBlah.cshtml
Therefore, our Test Harness Webpage does Not use a URL to locate the "UI component Under Test", but rather a directory path ( relative path or absolute path ) within the computer system.
The problem is that most Selenium and PhantomJS code examples show the "component Under Test" being tested by using a URL. For example,
Code:
ChromeOptions options = new ChromeOptions();
options.AddArgument("--start-maximized");
options.AddArgument("--disable-extensions");

IWebDriver driver =  new ChromeDriver(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\..\SeleniumConfigFiles"), options);

Uri  url = new Uri("http [colon] [forward slash] [forward slash]  localhost [colon] 2816 [forward slash]");    // Notice the URL being Used
IWait<IWebDriver> wait = new OpenQA.Selenium.Support.UI.WebDriverWait(driver, TimeSpan.FromSeconds(30.00));
Our team was interested in integrating Selenium and/or PhantomJS technology into the Test Harness Webpages
However, Most Selenium and PhantomJS code examples show the "component Under Test" being tested by using a URL. Our Test Harness Webpage loads the "UI component Under Test" by specifying the directory path ( relative path or absolute path ).
Could someone please show some Selenium and PhantomJS code examples that show the "component Under Test" being loaded by specifying the directory path ( relative path or absolute path ) within the computer system as opposed to using a URL ?

cslewis56

Posts : 1
Join date : 2015-02-27

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