I am trying to autoamte the eBay mobile native app using Selenium Appium.I am able to retrieve the page elements of all the pages however for the Sign In page I am not. I am getting error message in both UIAutomator and Appium Inspector 1.6.5 keeps searching with no response. I would like to know if the issue is with the eBay page or is there any other alternative ways to find the locators.
Steps to reproduce:
1. Search any object in ebay -> go to details page -> Click on watch
CaptureImage Issue
This issue occur if your appium server is on OR APP in mobile or emulator, now again open the app and navigate to screen you wanted. try this time
OR
stop your server and close this uiautomatorviwer and again open uiautomatorviwer. Your will not get the error this time.
another way to locate element is:-
Use below code :-
System.out.println("source : "+ driver.getPageSource());
driver.getPageSource() will return you the XML of screen.
Now you can construct an xpath on your element.
Use below link to beautify your xml
http://xmlbeautifier.com/
Use below code to validate your xpath
https://www.freeformatter.com/xpath-tester.html
Hope it will help you :)
Related
I have a difficulties with some content of the web-page when I am trying to discover the element
For example some part of the web-page is blocked by the following:
[data-testid=shell-content]
Any idea what could possibly cause following?
In the browser, the page isn't blocked and (all buttons) can be accessed by the keyboard or mouse.
Tried to upgrade to the lates version, still the same problem.
The problem was described against the iframe, it has to be handled in a similar way in order to access the elements
cy.enter('iframe[data-testid="iframe-content"]').then((getBody) => {
getBody().find('[data-test-id="create-user-button"]').click();
please note that name shell-content could be different to what was name in your project.
Upon typing xpath in fire-path text field, if x-path is correct then it'll display the corresponding HTML code. It was working fine previously.
But now it's not displaying the corresponding HTML code even though the xpath is correct.
Can anyone help me to find the solution for this problem? I even uninstalled fire-path and installed again but still, it's not working.
If you visit the GitHub Page of FirePath, it clearly mentions:
FirePath is a Firebug extension that adds a development tool to edit, inspect and generate XPath expressions and CSS3 Selectors
Now if you visit the home page of FireBug, it clearly mentions that :
The Firebug extension isn't being developed or maintained any longer. We invite you to use the Firefox DevTools instead, which ship with Firebug.next
So the direction is clear that we have to use DevTools [F12] which comes integrated with the Mozilla Firefox 56.x + releases onwards.
Example Usage :
Now, let us assume we have to identify the xpath of the Search Box on Google Home Page.
Open Mozilla Firefox 56.x browser and browse to the url https://www.google.co.in
Press F12 to open the DevTools
Within the DevTools section, on the Inspector tab, use the Inspector to identify the Search Box WebElement.
Copy the xpath (absolute) and paste it in a text pad.
Construct a logical unique xpath.
Within the DevTools section, on the Console tab, within JS sub menu, paste the logical unique xpath you have constructed in the following format and hit Enter or Return as follows:
$x("logical_unique_xpath_of_search_box")
The WebElement identified by the xpath will be reflected.
The new version of Firefox is not supporting firebug.
You can use chrome dev tools if you like so.
I personally writing XPath using chrome dev tools
For more info refer my answer here
Is there a way to get the xpath in google chrome?
Summary: When I try to go to the third page in a web site I'm trying to
screen scrape using Selenium and Chrome I can't find any elements on the third page.
I see Html for 2nd page in Driver.PageSource.
Steps:
Navigate.GoToUrl("LoginPage.aspx")
Find username and password elements.
SendKeys to Username and Password.
Find and click on Submit\Login button.
Web Site displays main menu page with two Link style menu items.
Find desired menu item using FindElement(By.LinkTest("New Person System")).
Click on link menu item. This should get me to the "Person Search" page (the 3rd page).
Try to wait using WebDriverWait for element on "Person Search" page. This fails to find element on new page after 5-10 seconds.
Instead of using WebDriverWait I then simply wait 5 or 10 seconds for page to load using Thread.sleep(5000). (I realize WebDriverWait is the better design option.
Try to find link with text "Person".
Selenium fails to find link tag.
I see desired "Person Search" page displayed in Chrome.
I see last page Html in ChromeDriver.PageSource.
Chrome geckodriver.exe. Build 7/21/2017.
NUnit 3.7.1
Selenium 3.4
VB
I used IE for another project with similar environment. Didn't have a problem getting to any page (once I coded Selenium correctly).
The web site I'm trying to screen scrape only supports recent IE version. I'm testing a legacy app for another project that requires IE 8. So using IE is out of the question.
Maybe I should try Firefox...
Can you help me to identify element ID or any other locator of timeline composer in Facebook profile ?
I need this to use in Robot framework with selenium2library to post something on my wall.
I can log in to Facebook, navigate to profile, but I cant input text into timeline composer. I tried to use Click element before inserting text, but no success.
I am using "inspect element" in browsers/firebug add-on to identify elements.
In this case, unfortunately all locators I have tried giving errors like:
Element does not appear in 5 seconds
or
Element must be user editable in order to clear it
Non dynamic locator for FB timeline-composer has name "xhpc_message_text" (18.10.2016)
Input text name=xhpc_message_text test
How can i navigate between different html pages using javascript?
I tried to use the below statement but it's not working. I have added a breakpoint and found that the below statement is executed.But still It doesn't display the page2.html.
WinJS.Navigation.navigate("page2.html", null);
Can anyone tell me why in what all scenarios it won't work ?
One option I found was iframe which I haven't tried yet.
This API isn't a specific page navigator; it's about loading the location as defined by the location service in WinJS:
http://msdn.microsoft.com/en-us/library/windows/apps/hh452768.aspx has the details on the specifics of using that model.
That stated, if you wish to use the normal Web model of a new page, either a normal link, or setting the window.location to the other page will cause a browser navigate.