Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» New! Appium Desktop
Today at 3:51 pm by azharuddin

» Selenium WebDriver Integration
Tue Nov 21, 2017 1:06 pm by azharuddin

» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir

» How to work on pages with AJAX in selenium?
Mon Sep 18, 2017 6:08 pm by azharuddin

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