GithubHelp home page GithubHelp logo

browserboss's People

Contributors

atifaziz avatar liamhughes avatar stephencleary avatar stuartleeks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

browserboss's Issues

add options arguments

Hi, please give me advice to add options arguments
I need to customize user-data-dir

Boss.Find() throws exception

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?

Boss.Find fails to find elements in iframes other than the first

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()

No such Session

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.