stephencleary / browserboss Goto Github PK
View Code? Open in Web Editor NEWEasily script browsers.
License: MIT License
Easily script browsers.
License: MIT License
Our unit tests are failing on some machines and passing on others. When they fail, they fail with:
InvalidOperationException: no such session
Any idea what might cause that? It has chrome and the latest Chrome Driver installed.
Just like we have Boss.Script
that calls into IJavaScriptExecutor.ExecuteScript
, it seems natural to have a member that exposes IJavaScriptExecutor.ExecuteAsyncScript
.
I need this for executing a script using XHR asynchronously in the browser. I can certainly go over IWebDriver
but if you'd be happy to entertain this addition then I can submit a PR.
When running in VS2013, the Find method throws, nags me, then ignores an exception:
unknown error: Syntax error, unrecognized expression: //table[contains(@Class,'item_list')]/tbody
(Session info: chrome=47.0.2526.80)
(Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.3 x86_64)
The call works fine though! Why do we get this message?
Hi, please give me advice to add options arguments
I need to customize user-data-dir
Boss.Find
(and other similar methods) that eventually relies on the algorithm in TryFind
for a collection of finders fails when looking for an element in an iframe
. While the algorithm is designed to search recursively through iframe
elements, it fails because the driver is always instructed to switch to the default content on line 57.
Boss.Find
(and other similar methods) that eventually relies on the algorithm in TryFind
for a collection of finders fails when looking for an element in a page with multiple iframe
windows and where the element sought is not in the first iframe
. While the algorithm is designed to search recursively through iframe
elements, it fails because the search loop forgets to switch back to the parent frame at the end of each iteration.
LINQPad query to reproduce:
Boss.StartChrome(hideCommandWindow: false);
Boss.Url = "http://jsfiddle.net/hmno8wfb/";
Boss.Click(".//a[@href='https://www.microsoft.com']");
The JSFiddle page used by the query contains two iframe
elements:
<iframe src="https://www.example.com/" width="600" height="240"></iframe>
<iframe src="https://www.tutorialspoint.com/html/menu.htm" width="600" height="240"></iframe>
The content of https://www.tutorialspoint.com/html/menu.htm
reads:
<html>
<body bgcolor="#4a7d49">
<a href="https://www.google.com" target="main_page">Google</a>
<br /><br />
<a href="https://www.microsoft.com" target="main_page">Microsoft</a>
<br /><br />
<a href="https://news.bbc.co.uk" target="main_page">BBC News</a>
</body>
</html>
The LINQPad query tried to click the second link in the second iframe
of the hosting page. Using version 2.0.2 on NuGet, the query should fail with an InvalidDataException
and a message reading:
Could not find elements matching .//a[@href='https://www.microsoft.com']
The stack trace of exception reads:
at Nito.BrowserBoss.Session.FindElements(ISearchContext context, String searchText)
at Nito.BrowserBoss.Session.FindElements(String searchText)
at Nito.BrowserBoss.Session.Click(String searchText)
at Nito.BrowserBoss.Boss.Click(String searchText)
at UserQuery
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.