Press enter in remote machine

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Press enter in remote machine

Ranjit kumar Kundu
Hi All,

In a automation process i am running  my scripts fro m Jenkins . In one script I am getting a child window in which i have popup to handle.

Steps what i have tried 

1.Action (not worked)
2. Alert (not worked )
3. Robot (worked but only in local machine)
4. Not worked 
public void pressEnter(){
 
Keyboard keyboard=((HasInputDevices) driver).getKeyboard();
     //enter a key
     keyboard.pressKey(Keys.ENTER);
 }

So now I just want to press enter which is handled by robot.pressKey() only in local machine , But it is not working in remote machine.


Any solution ?


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c1df90c5-47c9-4ec3-9337-0484ee61781e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Press enter in remote machine

David
Are you only able to solve that using robot keypress? Can't do it by some native Selenium call to dismiss the popup?

Because for the robot method, for it to work remotely means you have to run a remote "server" to accept the keypress command since robot is not Selenium Grid / RemoteWebDriver compatible.

Not sure if there is already some extension for selenium grid that adds robot Java class support for remote execution. Some other options as examples include:

https://github.com/sterodium/selenium-grid-extensions
github.com/daluu/AutoItDriverServer

where you use some similar/alternative tool to do the keypress remotely

On Tuesday, June 13, 2017 at 5:08:19 AM UTC-7, Ranjit kumar Kundu wrote:
Hi All,

In a automation process i am running  my scripts fro m Jenkins . In one script I am getting a child window in which i have popup to handle.

Steps what i have tried 

1.Action (not worked)
2. Alert (not worked )
3. Robot (worked but only in local machine)
4. Not worked 
public void pressEnter(){
 
Keyboard keyboard=((HasInputDevices) driver).getKeyboard();
     //enter a key
     keyboard.pressKey(Keys.ENTER);
 }

So now I just want to press enter which is handled by robot.pressKey() only in local machine , But it is not working in remote machine.


Any solution ?


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/11d981b3-5950-4fe0-9982-bb974ed9ed21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Press enter in remote machine

Ranjit kumar Kundu
Yes i can only able to do that using robot only when i am doing rdp to access the remote machine.

But when i am running from Jenkins as the screen is not active robot is not working. i have tried sikuli too , but no success when running from Jenkins. But sikuli is working when i am running that script locally from that remote machine using RDP.

On Wed, Jun 14, 2017 at 3:42 AM, David <[hidden email]> wrote:
Are you only able to solve that using robot keypress? Can't do it by some native Selenium call to dismiss the popup?

Because for the robot method, for it to work remotely means you have to run a remote "server" to accept the keypress command since robot is not Selenium Grid / RemoteWebDriver compatible.

Not sure if there is already some extension for selenium grid that adds robot Java class support for remote execution. Some other options as examples include:


where you use some similar/alternative tool to do the keypress remotely

On Tuesday, June 13, 2017 at 5:08:19 AM UTC-7, Ranjit kumar Kundu wrote:
Hi All,

In a automation process i am running  my scripts fro m Jenkins . In one script I am getting a child window in which i have popup to handle.

Steps what i have tried 

1.Action (not worked)
2. Alert (not worked )
3. Robot (worked but only in local machine)
4. Not worked 
public void pressEnter(){
 
Keyboard keyboard=((HasInputDevices) driver).getKeyboard();
     //enter a key
     keyboard.pressKey(Keys.ENTER);
 }

So now I just want to press enter which is handled by robot.pressKey() only in local machine , But it is not working in remote machine.


Any solution ?


--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/EkuQQFuRzCE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/11d981b3-5950-4fe0-9982-bb974ed9ed21%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

With Regard
Ranjit Kumar Kundu

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAFcbEfOF9VH15Z34d4sMebOtUsG8ay1cX2ho3Ys2a9nN3S8n5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Press enter in remote machine

David
Since you need UI focus and are running from jenkins, you probably need something like this:

https://autumnator.wordpress.com/2011/11/18/how-to-run-remote-headless-gui-automation/

also, hopefully you know why you have your particular problem, and if not, then hopefully the above article explains why. And the referenced solutions there should be able to help you out.

On Wednesday, June 14, 2017 at 6:35:47 AM UTC-7, Ranjit kumar Kundu wrote:
Yes i can only able to do that using robot only when i am doing rdp to access the remote machine.

But when i am running from Jenkins as the screen is not active robot is not working. i have tried sikuli too , but no success when running from Jenkins. But sikuli is working when i am running that script locally from that remote machine using RDP.

On Wed, Jun 14, 2017 at 3:42 AM, David <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="M6-h5RKZAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mang...@...> wrote:
Are you only able to solve that using robot keypress? Can't do it by some native Selenium call to dismiss the popup?

Because for the robot method, for it to work remotely means you have to run a remote "server" to accept the keypress command since robot is not Selenium Grid / RemoteWebDriver compatible.

Not sure if there is already some extension for selenium grid that adds robot Java class support for remote execution. Some other options as examples include:

<a href="https://github.com/sterodium/selenium-grid-extensions" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fsterodium%2Fselenium-grid-extensions\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFjdmJ_tfiOfPHF4hPoGT13sTbh5g&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fsterodium%2Fselenium-grid-extensions\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFjdmJ_tfiOfPHF4hPoGT13sTbh5g&#39;;return true;">https://github.com/sterodium/selenium-grid-extensions
<a href="http://github.com/daluu/AutoItDriverServer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Fdaluu%2FAutoItDriverServer\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFuuy2PVANgnYa_dP14Noc2C0L6hA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Fdaluu%2FAutoItDriverServer\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFuuy2PVANgnYa_dP14Noc2C0L6hA&#39;;return true;">github.com/daluu/AutoItDriverServer

where you use some similar/alternative tool to do the keypress remotely

On Tuesday, June 13, 2017 at 5:08:19 AM UTC-7, Ranjit kumar Kundu wrote:
Hi All,

In a automation process i am running  my scripts fro m Jenkins . In one script I am getting a child window in which i have popup to handle.

Steps what i have tried 

1.Action (not worked)
2. Alert (not worked )
3. Robot (worked but only in local machine)
4. Not worked 
public void pressEnter(){
 
Keyboard keyboard=((HasInputDevices) driver).getKeyboard();
     //enter a key
     keyboard.pressKey(Keys.ENTER);
 }

So now I just want to press enter which is handled by robot.pressKey() only in local machine , But it is not working in remote machine.


Any solution ?


--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/selenium-users/EkuQQFuRzCE/unsubscribe" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/topic/selenium-users/EkuQQFuRzCE/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/selenium-users/EkuQQFuRzCE/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/selenium-users/EkuQQFuRzCE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="M6-h5RKZAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">selenium-user...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="M6-h5RKZAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">seleniu...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/selenium-users/11d981b3-5950-4fe0-9982-bb974ed9ed21%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/selenium-users/11d981b3-5950-4fe0-9982-bb974ed9ed21%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/selenium-users/11d981b3-5950-4fe0-9982-bb974ed9ed21%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/selenium-users/11d981b3-5950-4fe0-9982-bb974ed9ed21%40googlegroups.com.

For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--

With Regard
Ranjit Kumar Kundu

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/e6b76bd2-7936-440f-b722-b205ea45ee62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Press enter in remote machine

Ranjit kumar Kundu
Below is the page source for which i ma getting that popup in the child window. Let me know if we could accept the popup using javascript Executor. 

<script type="text/javascript">
	function selectContinue( ) {
   	var check = true;
   	check = checkBoxEvent(document.reprocessParamForm, document.reprocessParamForm.reprocessParam);
   	
   	if (check) {
      	if (document.reprocessParamForm.reprocessParam[4].checked && document.reprocessParamForm.reprocessParam[5].checked) {
        		alert('Not valid selection  to check  both Fax all children and Fax to receive Code options'); 
        		return;
      	}
      	
      	if (document.reprocessParamForm.reprocessParam[5].checked && document.reprocessParamForm.reprocessfaxCode.value.length == 0) {
        		alert('Please enter receiver code if Fax to receive Code option is checked');
        		return;
      	}
   	}
   	
   	if (check) {
   		var paramIds = checkBoxIds( document.reprocessParamForm,document.reprocessParamForm.reprocessParam);
   		window.opener.fromPopup( paramIds , document.reprocessParamForm.reprocessfaxCode.value );
   	} else {
      	window.opener.fromPopup( null , document.reprocessParamForm.reprocessfaxCode.value );
   	}
   	
   	window.close();
	}
	
	function checkBoxIds(form, obj) {
		var total = 0;
		var Ids = new Array();
		
		if (obj == null) {
			return null;
		}
	       	
		var max = obj.length;
		
		if (""+max =='undefined') {
			if (obj.checked) {
         	return obj.value;
			} else {
				return null;
			}
		} else {          
			for (var idx = 0; idx < max; idx++) {
				if (eval("obj[" + idx + "].checked") == true) {
    				Ids[total] = obj[idx].value;
					total += 1;
   			}
			}
				
     		if (total < 1) {
     			return null;
     		} else {
       		return Ids;
     		}
		}
	}
	
	function checkBoxEvent(form, obj) {
		var total = 0;
		
		if (obj == null){
			return false;
		}
				
		var max = obj.length;
		
		if (""+max =='undefined') {
			if (obj.checked) {
	   		return true;
			} else {
				return false;
			}
		} else {
			for (var idx = 0; idx < max; idx++) {
				if (eval("obj[" + idx + "].checked") == true) {
    				total += 1;
   			}
			}
				
     		if (total < 1) {
     			return false;
     		} else {
       		return true;
     		}
		}
	}
</script>

On Thu, Jun 15, 2017 at 12:55 AM, David <[hidden email]> wrote:
Since you need UI focus and are running from jenkins, you probably need something like this:


also, hopefully you know why you have your particular problem, and if not, then hopefully the above article explains why. And the referenced solutions there should be able to help you out.

On Wednesday, June 14, 2017 at 6:35:47 AM UTC-7, Ranjit kumar Kundu wrote:
Yes i can only able to do that using robot only when i am doing rdp to access the remote machine.

But when i am running from Jenkins as the screen is not active robot is not working. i have tried sikuli too , but no success when running from Jenkins. But sikuli is working when i am running that script locally from that remote machine using RDP.

On Wed, Jun 14, 2017 at 3:42 AM, David <[hidden email]> wrote:
Are you only able to solve that using robot keypress? Can't do it by some native Selenium call to dismiss the popup?

Because for the robot method, for it to work remotely means you have to run a remote "server" to accept the keypress command since robot is not Selenium Grid / RemoteWebDriver compatible.

Not sure if there is already some extension for selenium grid that adds robot Java class support for remote execution. Some other options as examples include:


where you use some similar/alternative tool to do the keypress remotely

On Tuesday, June 13, 2017 at 5:08:19 AM UTC-7, Ranjit kumar Kundu wrote:
Hi All,

In a automation process i am running  my scripts fro m Jenkins . In one script I am getting a child window in which i have popup to handle.

Steps what i have tried 

1.Action (not worked)
2. Alert (not worked )
3. Robot (worked but only in local machine)
4. Not worked 
public void pressEnter(){
 
Keyboard keyboard=((HasInputDevices) driver).getKeyboard();
     //enter a key
     keyboard.pressKey(Keys.ENTER);
 }

So now I just want to press enter which is handled by robot.pressKey() only in local machine , But it is not working in remote machine.


Any solution ?


--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/EkuQQFuRzCE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/11d981b3-5950-4fe0-9982-bb974ed9ed21%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

With Regard
Ranjit Kumar Kundu

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/EkuQQFuRzCE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/e6b76bd2-7936-440f-b722-b205ea45ee62%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

With Regard
Ranjit Kumar Kundu

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAFcbEfO7_B2N96n8gwc9aQcW5Cy2Y%3DZ4BSVsuOKkvfhJAjfNfw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.