Why is RFT not recognizing the objects I have on a windows Print dialog.Included are few screen shots.
I am able to get the correct activeWIndow by
TestObject[] to ;
IWindow activeWindow = RationalTestScript.getScreen().getActiveWindow();
System.out.println("Class of active window is "+activeWindow.getCLass()): // returns #32770
ScreenTestObject root = RootTestObject.getScreenTestObject();
to = root.find(atLIst(atDescendant(".class", false),atChild(".class", ".Pushbutton", ".text", "Print"))) ;
Apparantly I can't post pictures. here is the link for print window and print button properties screenshot
http://www.flickr.com/photos/24358027#N07/12977082214/in/set-72157641973533994
...resolutions is horrible, I can type all the information if anyone needs it. Sorry and Thanks in advance.
Try The below Code snippet. I tried launching the print dialog from notepad and ran below script to find the print button and click it.Hope it helps.
//Find the Print button
TestObject[] to = find(atDescendant(".class",".Pushbutton",".text","Print"),true);
System.out.println(to.length);
//If you are sure you have just one print button on screen.
if(to.length==1)
((GuiTestObject) to[0]).click();
//Else traverse through the found object and compare the properties of the button you want to click
Update : I did a workaround for this, using tab to navigate. Once Tab is on the button, I input Enter. So it's not a work stoppage issue anymore, but I do need to figure out the right way to do it.
Thanks
Related
enter image description here
I'm trying to print this 91040 from the site but I can't seem to do it and I think the reason is that 91040 is not visible on the site but only on inspect.
element = driver.find_element(By.XPATH,'//div[#class="code-container"]//span[2]')
When I paste this XPATH in the find bar on Inspect it locates the item but when I'm trying to print the element nothing gets printed. I tried these options.
print(element)
print(element.text)
So I'm thinking that the problem is that 91040 is not an actual visible text.
For anyone having the same problem I found the answer
hidden_text = element.get_attribute("textContent")
Im using active report 12 with vb2015
What im looking for is to print the document without showing the report screen
Please any help..
You can try:
PrintExtension.Print(report.Document`)
You can refer here -> https://www.grapecity.com/blogs/print-without-viewing
I have a problem in scanning a drop-down menu which disappears upon opening the xScan. I need to get the module id of the dropdown menu to verify some test steps.
Do you have any solution with this if it is not really possible to get the module id of the dropdown menu?
Open developer tools in your browser of choice (F12), navigate to the console and input the following code:
var fulldoc='';
var scrollX=0;
var scrollY=0;
document.addEventListener("keydown",function(event){
if(event.key=='q' && event.altKey){
fulldoc=document.body.outerHTML;
scrollY=window.pageYOffset;
scrollX=window.pageXOffset;
}
if(event.key=='w' && event.altKey){
document.body.outerHTML=fulldoc;
document.body.scrollTo(scrollX,scrollY);
}
});
When the window looks the way you would want to scan, press 'Alt + Q', then press 'Alt + W'.
Now your window will freeze and then you can scan your page.
To steer the objects you need to refresh your browser.
You can resolve the issue with below 2 steps
1 - Add some text in textbox which will populate the dropdown below it .
2 - Use Send Keys Module to scroll down and select the value.
I had a similar issue where we had a popup that only appeared when clicking on a text box. The solution we received from the Tricentis trainer was as follows:
Part One
1. Open your application in Chrome
2. Right click the inspect
3. In the inspector window, on the Elements tab, navigate to your html element where it should be (you can do that by clicking on the element and check that you can see the html in the element)
4. Use the debugger to add a break point there, this should pause it and you should be able to see the elements you need to steer it.
5. Once you found the element, you will need the type of element (e.g. div, span, etc), and the class name
Part two
1. Rescan your module and select any element that matches the criteria of your element selected in Part One #5
2. Identify it by only it's class name property and tag
3. Save and close
4. Edit the element in the module view by changing the class name. This should help you steer it
Note: if the element class name is not unique, you might need to use Explicit name.
Good luck
I have been trying to do this myself, but I just dont know how to define the problem. I have been writing a Macro for LibreOffice and it includes several dialogs. When I Run the macro I want to execute a Function after the dialog is visiable. I could not find the solution to this so I made another dialog which only shows "Loading, Wait..." and I inserted at the beggining and end of that function, dialog.Execute() and dialog.endExecute(). I guess the program stops at .execute() and im stuck at "Loading, Wait..." sign if I press "X" in the corner the program continues normally.
Best solution would be if I could run a function after the dialog is visible. So is there sort of a trigger ?
You can load the dialog and make it visible, but this would not activate the functions (buttons etc.), as this is what execute does
' StarBasic
' Tools
With GlobalScope.BasicLibraries
If ( Not .isLibraryLoaded("Tools") ) Then
.LoadLibrary( "Tools" )
End If
End With
sampleDialog = LoadDialog( "Standard", "Dialog1")
sampleDialog.setVisible(TRUE)
Does this help you?
I have 3 search box field and 3 question marks near by each search box. If I try to click on the 2nd question mark, It always clicks the 2nd Search box instead of clicking the question mark button. [Sikuli not clicking the exact element]1 Kindly have a look into the below image i have attached. Click "1" to view the image... Pls dont come up with coordinates. I shouldn't use coordinates in my project.
Well, this may not be the fully qualified answer, which do not use Region, Co-ordinates & autoIT as you are expecting.
This is code in Sikuli which uses findAll() method.
I created a dummy window as per your screenshot as below:
Edit
public void clickButton() throws AWTException, FindFailed
{
m_sikscr=new SikuliScript();
m_screen=new Screen();
m_sikscr.switchApp("Java Swing Examples");
m_screen.wait((double)3.0);
int i=0;
Match[] array=new Match[5];
Iterator<Match> rs1 = m_screen.findAll(new Pattern("./img/Button1.png"));
while(rs1.hasNext())
{
array[i]=rs1.next();
i++;
}
m_screen.click(array[1]);
}
This clicks only the second button on screen.
Hope this much triggers the thought of making it work completely.