How to scroll down with Selenium WebDriver using C#? - c#

I'm making an automated updater on a google docs and i've been stuck for many hours trying to figure out how to trigger a scroll down on the spreadsheet,
i've also tried other solutions posted here
right now i'm trying to trigger it through javascript, weird thing is that it works on other website but for the google docs spreadsheet it's not working
here is my code on scrolling down:
js.ExecuteScript("window.scrollTo(0,Math.max(document.documentElement.scrollHeight," +
"document.body.scrollHeight,document.documentElement.clientHeight));");
I need help if there's any other solution
thanks in advance

While I am a massive fan of selenium, is it really the best tool for updating a Google Docs spreadsheet?
Unless I was working for Google, and I would not try and automate this application.
However, there is an API provided by Google specifically to access spreadsheets;
https://developers.google.com/google-apps/spreadsheets/
Going via the API will be far faster and reliable.

Related

How to disable ctrl + mousewheel zoom in a console Application

I'm currently writing a console application with some custom console GUI and want to use ctrl, shft and alt when using the mousewheel to increment a number. However since Windows 10 you can use ctrl + mousewheel to zoom in/out the entire console window. I'm working in .Net 6.0 and don't mind using c++ or any pinvoke's even if it just works for windows machines. It needs to be solved programmatically however, so playing with OS settings or using Autohotkey is not an option for me. I did try to look up solutions on google/stackoverflow and as far as I understand globalkeyhooks seem to my best bet, however every article is either outdated or .Net Framework specific. If someone knows a link to an article with the information im looking for, I am more than happy to read through it myself to save the trouble. Thanks in advance
Failed attempts to write a globalkeyhook after searching through countless articles

C# BluetoothLE How can I getting started

I am new to this business and I want to make an application related to Bluetooth LE. I don't know where to start, I want to do it using a library. I searched libraries such as 32feet.Net, InTheHand.BluetoothLe, Plugin.BluetoothLe, ble.net but I could not figure out how to make a windows form app or what can I do and where to start. Can anyone help?
Bluetooth on windows has always been difficult with very few examples to learn from.
I think the most up to date way is probably to make a UWP application and use the Windows.Devices namespace. I've never tried it that way though.
There are examples of this here: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothLE
If you want to use 32feet.net, you will find some sample code in an old question of mine here:
Bluetooth Pairing (SSP) on Windows 10 with 32feet.NET
I got the basics of searching for devices working, but never got the pairing to work how I wanted, and the question never got an answer despite someone placing a bounty on it. Hopefully it at least puts you on the right path.

Automated Flash Testing with C#

I am trying to write some software for automated testing of flash contained within webpages.
Specifically I am looking for assistance with 'hooking' onto a webpage which is running the flash and gaining access to the controls and events it uses so that I can simulate button clicks and then listen for the responses it produces.
Since it could be any flash movie running, I need to be able to gain access to the controls so I can try and make an educated guess as to which ones I need to simulate clicking.
I need it to be free or perhaps open source hopefully with examples ideally in a .net technology.
Can anyone offer assistance or examples, please?
Many thanks
There is Ruby library called FlashWatir. Not exactly what you were looking for, but close.
First, Flash pages can be manipulated with JavaScript. For a reference on this see: http://www.adobe.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_06.html
You can write something in C# or use Selenium (open source) to test the whole thing with some scripting. Selenium Remote Control has support for DotNet.
Selenium Remote Control
http://seleniumhq.org/projects/remote-control/
Tutorial on using Selenium to test Flash:
http://wiki.openqa.org/display/SRC/Testing+Flash+with+Selenium+RC
Hope this helps.

To Develop an Application:Using Mobile Camera as a Web Cam

I have been tasked with doing this application:
So far: I have a J2SE application which builds a bluetooth service and waits for an incoming connection.
A J2ME application which searches for the service and when a match is found, it streams images clicking continuously with the phone's camera. The J2SE app accepts the images and displays them on the desktop machine.
But according to my project specification, I need the desktop application to be developed in C#.
What I tried?
I tried to read the J2SE code line by line and reproduce the same in C#. After googling around I found that 32Feet library was a good choice. So I went ahead and read the documentation which has code samples in VB, and tried to implement it in C#. It started well with me discovering the local device successfully but eventually i got stuck in the part related to the creation of Bluetooth service.
While most of the terminology is same with ServiceRecord, UUID/GUID etc...but I have failed miserably. Moreover I tested some code which works in VB but fails in C#. Even I tried OBEX...(a small file transfer test) which worked yesterday but fails today with an exception.
Now I am contemplating of starting from scratch all over again. Can someone help me please in suggesting ways to proceed further. I mean in what tools/library/environment should i opt for. What is the best and reliable way to develop the desktop app in C# with the J2ME app already developed.
Help required please. All suggestions even small ones are welcome. I am relatively new to both Bluetooth and C#. I have some experience in Java and J2ME.
Its sad to see that you wish to leave back those libraries you did used and spend alot worty time tinkering with it.
Rather than leaving that effort, try to resolve it. Let us know what exceptions/errors your facing with those libs.
Many experts here shall surely help you with it. Or talk to the developer of those libs for any help needed.
Hope this kind of helps Bluetooth in C#, Which stack, Which SDK?

Using webcam's button in my own program

My webcam has a button, with which you take a photo of current frame
when using it's original software what came with it when I bought it.
Is there any way to use that button to take photos in my program.
I would be using C#.
I was thinking of using Windows Image Acquisition (WIA) or avicap32
for using webcam in my software.
Any help would be appreciated. Where do I start?
EDIT:
I see that you didn't understand me. I need to know if my phisycal camera button is pressed.
I am using DigiMicro 1.3 camera (Manufacturer is DNT), which isn't really a webcam but a USB microscope, but
it behaves like a webcam.
Does the camera actually require that the software be running when you press the button? I know some webcams implement this feature at the driver level. If that's the case, I don't think there's much you can do without interacting directly with the USB port, which would be incredibly difficult and likely not worth the trouble. I can't find any technical documentation on the vendor's website with that kind of information.
The "MicroCapture" software doesn't come with any DLLs that have exported functions, so P/Invoking doesn't appear to be an option. Unfortunately, I can't get the driver installed, so I can't check if it comes with any P/Invoke-able DLLs.
Sorry, but since there's no standard interface for that kind of functionality and the vendor doesn't provide any specific information on it, I don't think this is possible. I would suggest contacting DNT directly about it. They may have some component that will do what you need.
This Coding4Fun post guides you through pretty much everything you need to do to get started using WIA, including adding the reference to a project, displaying the select a device dialog, and of course actually taking the picture :P.
Coding4Fun - Look at me! Windows Image Acquisition
I suggest that you take a look at the DirectShow.NET library. It has great functionality for capturing images/videos off connected devices. It also comes with several samples to get you started quickly.

Categories