Unable to get correct value from a UIAButton - ios-simulator

While using the Appium Inspector, unable to get correct value from a UIAButton.I want to get value(i.e. "17:20") from button, but in inspector it shows name of background image in name and label attribute of button and value attribute is null. I am not able to understand why background image name shows in name attribute of button. And is there any other way to get this 17:20 value
Please find below screenshot for button and its details. .

Are you sure you have selected the correct element?
When clicking at an object with the inspector, it's often selecting objects in the background.
To ensure you have the correct element selected, use the tree selector on the left of the inspector's preview window.

Try to put an accessibilityValue to the button, where you initialise the button.
self.yourButton.accessibilityValue = [NSString stringWithFormat:#"%#", getYour17:20Valuehere];
In Appium you then ask yourButtonElement.getAttribute("value").

Related

GTM Click Element does not fire on click

I want to fire a GTM trigger based on the div the button is in.
The Tag Details show the Click Element condition is not met:
But the Variables on the exact same Click show the Click Element does contain 'div.website-notice':
I cannot figure it out. Please help :)
Updated GTM Debug output is misleading. Click Element value is HTMLElement not a string so you have to use matches CSS selector condition instead of contains in your trigger.
You can use "match css selector" as contain.
The click element seems not working the same way as other built-in variables.

Trying to display the export value of a dropdown menu selection in Adobe PDF

Let me start off by saying I have very limited knowledge of Javascript.
I've got a Dropdown menu called: CustomerType with 6 values in it.
Basically I just want whatever is selected in the dropdown to display again in another part of the PDF.
Can anyone help?
First set the properties on the dropdown to commit the value immediately. See image.
Then on the "calculate" script for the other field, enter the JavaScript below. You'll need to change the field names to your actual field names.
this.getField("myOtherField").value = this.getField("myDropdown").value;
You'll want to set the other field to read-only as well since the value is calculated.

No event getting generated on button click in MFC

I have a dialog based application. I have one static text control and a button on this, both of which I have made invisible in the beginning. I want to show both the controls on reaching a certain condition. When I click this button, again I want to make both the controls invisible.
However, I am able to show and hide the control and also captured the button click event like this:
ON_BN_CLICKED(IDC_MY_BUTTON, &MyDlg::OnBnClickedMyButton)
and defined OnBnClickedMyButton().
But when I press the button, it is not pressed and the event is also not generated.
Any suggestions?
First check if the IDC_MY_BUTTON exists and is valid.
Remember to add DECLARE_MESSAGE_MAP() at the header file.
Also check at the BEGIN_MESSAGE_MAP(MyClass,MyParentClass) if the class
and the parent class you write are right.
I hope this helps.
I think the IDC_MY_BUTTON maybe is invalid or other control has the same ID.
Well, finally I have come to know that though the button was visible but on clicking it was not taking control, hence I used BringWindowToTop() to draw it on top. Now it is being clicked and OnBnClickedMyButton() is also being called.
But now the issue is that after calling BringWindowToTop() the button is not shown. It is shown only when I take the mouse pointer on it. Not able to understand what is the issue.

Selenium record and play back a css element

When i try to playback a recorded script, in which there is a click on css drop down like thing and select an option from it, i got the following error:
"Element not found".
Here there is nothing like loading so that it takes some time and element is not visible. It's just a plain web page.
Please help me in resolving this issue and go on with the recorded script.
Try invoking a mouseOver command on the underlying element, that should give the dropdown menu a hint to appear and the element you're missing will be visible.

Can't click overlapped element within a popup(not main window),how to scroll it to view?

As you can see,I can click the first check box(PRODUCT-323),but can't click the second.After a long
trying,I find it is because the second doesn't get scrolled to view(Is it intented by tool design or a bug?).So how to scroll this popup div to ensure the second get shown?
Actually,I have tried this,but failed
((JavascriptExecutor)driver).executeScript("document.getElementById("pupop").scrollTo(0,30)");
Can you please share which version of WebDriver are you using?
If I remember correctly, Version 2.16 or so had a known issue with locators not scrolling into view. The reason being,, they were using the position co-ordinates of the center of the element to bring focus and in this case, the center is hidden from view. This was solved in later versions.
There are a couple of approaches.
1) Try to perform some action on an Element that is completely hidden from view.This will bring the element fully into view and you will be able to access it.
In this case, try to access the checkbox in 3rd or the 4th row, you will be able to bring focus there. Then access the 2nd row.
2) Do a Driver.Manage().Window.Maximize() [This is in c#]. This will also bring the element into view.
It is a good practice to avoid a window with both scroll-bars. By maximizing it you will reduce the window for such errors.
Hope this is useful.
Did u try the keyboard options?? ctrl+ down arrow through script???
Or in the worst case use tab to focus on to that checkbox.. I works in OpenScript and RFT this way.
1) To click the second checkbox: You can use the xpath to find that element. In xpath you can easily get the table row id for each checkbox which will gets incremented in their ID.
2) To scroll you can use the below code:
JavascriptExecutor js = (JavascriptExecutor) webdriver;
js.executeScript("scroll(0,0);");

Resources