Unable to find IDs of a hybrid App - selendroid

I have been using Selendroid; it works perfectly for native apps, but for some of the hybrid apps, it is not working properly. With the Employee Directory.apk, Selendroid Inspector works fine (able to get all the IDs), but for another hybrid app which I am trying, Inspector is not able to show the element IDs. Workaround: somehow I got the ID of a button (of a hybrid app) and am able to click on the button, but I want to get the ID from the Selendroid Inspector.
What could be the reason why the Inspector is unable to show these IDs?

If you are using chrome, type this into the address bar
chrome://inspect/#devices.
Just attach a device/emulator, open a browser and click on inspect on the inspect option.
This will let you access the id's, and different properties of the element you want.
You can build XPath addresses using those properties.

When it comes to hybrid apps. Some of the buttons might not have ids. It all depends if the developer added the ID. So you have to resort to cssSelectors, xpath or smth else. I asked the developer of the app i was testing to add id's to the button.

Related

How to access Gmail messages selected (checkbox)

I am trying to build an Add-On for gmail which will perform some actions on a set of messages selected by the user.
Looking at the gmail Apps Script API, I cannot see a method that allows me to do that.
I've noticed that some AddOns operate on selected messages, just like what I want to do. See picture below...
The checkboxes (highlighted in green) tell the AddOn what to operate on.
What am I missing?
The opened menu has options to forward the messages selected by combining them.
Also, I noticed that this AddOn is placed by google along the top. The same happen to the boomerange AddOn. The AddOn I am developing, always appears on the right hand side (pink arrows).
How can you place your addOn along the top menu?
The items you reference with the orange arrows in the image are not Gmail Add-ons, they are actually Chrome Extensions. Chrome Extensions are installed in the browser and they can add functionality by manipulating the DOM (Document Object Model) of a webpage. The chrome extension in question is probably specifically targeting chrome tabs with Gmail loaded and injecting content in the respective pages.
If you want to learn more about developing Chrome Extensions check out the following documentation:
https://developer.chrome.com/extensions/devguide
And for developing gmail specific Chrome Extensions you might want to check out the InboxSDK framework linked below:
https://www.inboxsdk.com/

Testing Chrome Extension with Context Menu

I am working on a Chrome Add On that adds context menu items using chrome.contextMenus.
I am looking to create some tests as I develop the extension to ensure proper functionality. I have looked into using Selenium and similar, but there does not seem to be the concept of interacting with the "system" context menu, only context menus which are actually JavaScript called by intercepting right clicking. The solutions for the browser's real context menu seem a bit hacky.
I am starting to look at things like autohotkey and AutoIt, but I am not sure that these are the best tools out there for this type of testing since Chrome doesn't use native Windows controls.
I see there is some work with AutoIt Chrome UDF, but I wanted to check if there was a purpose built tool that can consistently interact with the browser. I also want to check that other tabs are open, etc.
I have read How do I test a context menu entry in a Chrome Extension? -> Select an Option from the Right-Click Menu in Selenium Webdriver - Java , but I am not sure how this would work if you don't know which menu items might be present from other extensions or customizations.

Create a chrome extension which modifies a web page?

every time I go to a particular web page I hit F12 delete a node and uncheck a few absolute position boxes on two others. I would like to know how to do this with a chrome extension.
I have not made a chrome extension before so I thorough guide to making one would also be appreciated
I recommend you to read this guide first as Google suggests.
http://developer.chrome.com/extensions/getstarted.html
Also, I think in order to implement what you want to do, you'll need to use page action.
So, take a look at this page about page action.
http://developer.chrome.com/extensions/pageAction.html

Get Window Handle of Chrome Tab from Within Extension?

I've written a Chrome Extension (w/ NPAPI as well) that allows my application and Chrome to communicate with each other. That is all mostly working fine.
What I'm trying to do now is be able to tie the HWND of a Chrome window to a particular Window ID & Tab ID.
When I'm inside of Chrome (via the plugin) I have the Tab ID and Window ID and I can do most operations based on that.
When I'm outside of Chrome (via my application) I can see the window structure and get the HWND of the various tabs.
Is there any way that I can tie them together reliably such that my application could tell Chrome to get me information about/from a specific tab?
If you have Spy++ you'll see that site titles stay consistent with tab window titles. You should definitely use that.
To eliminate title collisions simply call chrome.tabs.query() and chrome.tabs.update() from extension to save, change, and restore a tab's title. Then use GetCurrentProcess() and EnumWindows()/WindowEnumProc() to get child windows hierarchy and match your custom title. You will have to pass it to an EnumWindowsProc callback function.

How can I display the same DOM across several tabs in a Chrome Extension?

I'm looking to build a chrome extension that allows the user to have an independent subwindow that is the same in each tab (for example you are taking notes and the notes are synchronized among each tab). Also, clicking a link should not destroy this subwindow.
One solution is to inject an iframe in each tab, and try to synchronize this data serverside and send back to each client tab, as it is updated.
This seems very tedious, plus the iframe would be provided by a third party, and I want to make it the easiest for them.
Is there a way I can have a shared dom piece and display it in its current state across several tabs?
There's an API (still experimental as of Chrome 17) that does more or less exactly what you want. If you visit about:flags, and enable "Panels" (they're enabled by default in Dev and on Canary (and on ChromeOS)), you'll be able to use chrome.windows.create with a type of panel to create a floating pane that exists independently from the browser window. That would likely meet your need.
Take a look at the Google Talk extension for an example of how it might work.